Question

I need good resolution pictures from "photo" type posts. The general "[user_id]/feed" api endpoint gives you a "picture" field with bad resolution. The good resolution ones come in a field called "images" that doesn't seem to be included in that endpoint. I can only get them when calling with [post_id] directly. E.g.: http://graph.facebook.com/10151901949756749

I'm noticing the Post class in com.restfb.types doesn't have an "images" attribute so it doesn't seem like "fetchObject([post_id], Post.class)" would work.

How can I get these images?

Was it helpful?

Solution

In facebook API, we get the pictures with different dimensions, as different sizes of the same images are saved. But some basic conventions can be helpful to identify the resolution of images:

  1. _s.png or _s.jpg , this represents small image.
  2. _n.png or _n.jpg , this represents normal image.

So for example when you call : http://graph.facebook.com/10151901949756749

You get a sub part something like this:

   {
   "picture":"...._s.png",
   "source": ".._n.png",
   }

Here, instead of fetching picture you can retrieve source , and the image you will get will be of better resolution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top