1. A method comprising: by one or more computing devices, accessing an image file associated with a first user; by one or more computing devices, detecting a face in an image corresponding to the image file; by one or more computing devices, accessing a social-networking system associated with the first user and a plurality of second users, wherein: the social-networking system comprises a graph that comprises a plurality of nodes and edges connecting the nodes; at least one of the nodes corresponds to the first user; and for each of the second users, at least one of the nodes corresponds to the second user; and by one or more computing devices, determining one or more candidates among the second users to be matched to the face, wherein the determination is based at least in part on: a comparison of temporal and spatial proximity of the second users, as indicated by the social-networking system, to a time and place associated with the image with a threshold temporal and spatial proximity; and a comparison of degrees of separation between the second users and the first user indicated by the social-networking system with a threshold degrees of separation.