1. A method comprising: by a computing device, determining one or more points of interest in an image, wherein each of the points of interest corresponds to (1) a user represented by a user node in a social graph of a social-networking system or (2) a concept represented by a concept node in the social graph; by the computing device, assigning a weight for each of the one or more points of interest in the image based on social-networking information accessed from the social graph of the social-networking system; by the computing device, analyzing a plurality of viewport test positions, each comprising at least a pre-determined number of the weighted points of interest, wherein the analyzing comprises: setting boundaries of the viewport test position wherein at least one of the boundaries coincides with a position of one of the weighted points of interest; and identifying any weighted points of interest in the viewport when the viewport is located at the viewport test position; by the computing device, selecting one of the analyzed viewport test positions based on a respective number of the identified weighted points of interest and their assigned weights, and further based on a padding amount in the viewport; and by the computing device, cropping the image based at least in part on the selected viewport test position.