1

I found a picture saved to my gallery from the Facebook Messenger app. How can I find out who sent this picture to me?

When I go to the picture and click on details it tells me:

title: received_123456789012345
time: 13-7-15 8:43 
type: image/jpeg 
resolution: 450x744 
orientation: 0° 
size: 19.18kb 
path:/storage/emulated/0/DCIM/Facebook/received_123456789012345.jpg
2

It would be a privacy disaster if the meta information of that image contains the name or email ID of the sender. Anyhow, this answer assumes that the message (not the whole thread) from which you downloaded the image exists in your inbox. If you've deleted the message, ignore this answer.

In the file name received_123456789012345, the numeric string after received_ is the identifier (ID henceforth) of that image on Facebook.

If you happen to open that image from the message using a web browser in your mobile (if you're on desktop, switch user-agent to mobile), notice the string next to fbid= in the URL bar:

https://m.facebook.com/messages/attachment_preview/?mid=mid.145450XXXXXXXXXXXXXXXXXXXXXXXXXXX&threadid=id.20XXXXXXXXXXXX&fbid=ID

It would be the same ID you saw in the title of the file you earlier downloaded.

How can I find out who sent this picture to me?

The sender's name of that image is in the column sender of table messages in database threads_db2 located under /data/data/com.facebook.orca/databases/.

Facebook Messenger app doesn't participate in backup and restore infrastructure of Android, so the only way to access that database is with root privilege.

Once you've root privilege, copy the aforesaid database to internal or external SD card.

Get info using apps

On Android

  1. Download an app that can open an SQLite database. (I prefer SQLite Editor.)
  2. Open the database in that app, open the table messages and if the app supports searching in all or particular fields then look into all or attachments the ID of that image.
  3. In the resulting row, the text in the column sender has the sender's name next to "name":.

    (Click image to enlarge)

    IMG: IMG: IMG:

On PC

If no Android app works for you, copy the database into PC and use an application that supports exporting a table into a format understood by a browser or text editor. Once you have the application, use it to export the table messages and search ID in the exported output.

I used Sqliteman. It supports exporting a table to HTML, CSV, XLS, among other formats.

Command-line

If you're up to the task, you can try a command-line way. Copy the database into PC, download sqlite3 tool, setup in PC and do:

sqlite3 -line DB_PATH "SELECT sender,attachments FROM messages WHERE attachments LIKE '[{%'" | grep -B1 "ID" | grep "sender"  # DB_PATH is the path to threads_db2 and ID is content identifier

(MS Windows doesn't come with grep utility. You'll have to download it. Otherwise, remove everything after '[{%'" and sort and search the output on your own.)

Note: Some Android versions are shipped with sqlite3 tool. You can run that last command in your Android, if you intend to.

Demo Output:

sender = {"email":"10000XXXXXXXXXX@facebook.com","user_key":"FACEBOOK:10000XXXXXXXXXX","name":"Lol Cat"}
  • 1
    In case you're wondering why go to all this trouble: I just wanted to post this answer to prove that there is indeed a method which doesn't involve checking all the chat messages, which is what I find tedious to do. My answer may be difficult to follow at first but would definitely work. – Firelord Feb 3 '16 at 18:27
0

There isn't any possible way as to find the name of the user from an image. you can probably open up your Messenger app and look through your chats to find it out.

  • 1
    "There isn't any possible way as to find the name of the user from an image" -- now that's a bold claim. How did you reach this conclusion? What feasible ways did you try before reaching this conclusion? – Firelord Feb 3 '16 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.