You can get a square picture of higher dimensions than the normal one for type=square
(which will be only 50x50 pixels in size) by requesting a picture with width
and height
parameters set.
See https://developers.facebook.com/docs/reference/api/user/, “picture” connection, quote:
“Additionally, you can specify width and height URL parameters to request a picture of a specific size. This will return an available profile picture closest to the requested size and requested aspect ratio. […] if width=height, we will always return a square picture.”
Example:
https://graph.facebook.com/4/picture?type=square – Mr Zuckerberg’s “normal” square profile pic, size 50x50
https://graph.facebook.com/4/picture?width=100&height=100 – 100x100 pixels, perfect match for requested size
https://graph.facebook.com/4/picture?width=150&height=150 – asking for 150x150, getting 156x156 instead.
If you can live with maybe sometimes getting images that might be a little bigger (or smaller) then the requested size, you should be fine.
Otherwise it’ll take some testing to try and figure out if there are certain square image sizes that Facebook will always have “in stock” and deliver exact matches for, or if it might differ for every user depending on the picture they uploaded.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…