1. A method comprising: by a computing device, accessing a social-networking information item and a media file associated with a first user, the social-networking information item associated with a social graph of a social-networking system, wherein the social graph comprises a plurality of nodes and edges connecting the nodes, each of the edges between two of the nodes representing a single degree of separation between the nodes, wherein at least one node of the social graph corresponds to the first user, and wherein attributes of the social-networking information item comprise a list identifying one or more second users associated with the social-networking information item, the one or more second users each associated with at least one node of the social graph having a limited degree of separation with the first user; by the computing device, determining based on a facial-recognition algorithm a matching score of each of one or more of the second users to each of one or more faces in the media file; by the computing device, for each of the second users with a matching score above a threshold value to a face in the media file: comparing first spatio-temporal information of the media file with second spatio-temporal information of the second user; and adjusting the matching score of the second user to the face based on the comparison; by the computing device, determining one or more potential matches between the second users and the faces in the media file based on the adjusted matching scores; and by the computing device, tagging the media file with information identifying the social-networking information item based on one or more of the potential matches between the second users and the faces in the media file.