Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve original/not modified image from home or feed

I retrieve photos from home with this graph API request https://graph.facebook.com/me?fields=home.filter(photos).
Then via the object ID I retrieve the images array that gives me different sizes like this :

"images": [
    {
      "height": 780, 
      "width": 1240, 
      "source": "https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-prn2/281028_10151592859979158_562775226_o.jpg"
    }, 
    {
      "height": 81, 
      "width": 130, 
      "source": "https://fbcdn-photos-g-a.akamaihd.net/hphotos-ak-prn2/s75x225/969715_10151592859979158_562775226_s.jpg"
    }

Is it possible to retrieve the originally posted image ?
The image retrieved has to have the same checksum then the image posted

like image 563
gsempe Avatar asked May 17 '13 16:05

gsempe


2 Answers

That's no 100% guarantee checksum is same, don't do that. Why? Because if you upload a .gif or .png image, Facebook would do conversion to become a jpeg image instead. So even though you upload a 1920*1280 .png image, what you can get is the modified version 1920*1280 .jpeg image. I have no idea facebook database would keep original image or not, but it's not what you can do using Facebook API.

like image 156
林果皞 Avatar answered Sep 29 '22 03:09

林果皞


I don't think you can get the exact, same image by the checksum that you uploaded to their servers. I would think that Facebook modifies them into certain formats so that the photo experience is consistent across the whole site.

That said, they could be keeping a copy of the original photo that was uploaded. But as far as getting access to it via the API or any other way, my best guess is looking at the 'source' according to the Facebook documentation on the Photo object:

The source image of the photo - currently this can have a maximum width or height of 720px, increasing to 960px on 1st March 2012

You can fetch it via the API by:

/<photo id>/?fields=source

Sorry it's not an exact answer, but I hope it helps.

like image 21
JayNCoke Avatar answered Sep 29 '22 04:09

JayNCoke