elauria elauria - 3 months ago 16
Javascript Question

Get Facebook Profile Picture in higher resolution

I was looking for the best way to get a user profile picture with the Facebook Graph API.

Looking through the documentation, I've found this:


You can specify the picture size you want with the type argument, which should be one of square (50x50), small (50 pixels wide, variable height), normal (100 pixels wide, variable height), and large (about 200 pixels wide, variable height)


My question is: Is there any way to get the profile picture on a higher resolution than 200px?

I've recently found this solution, but I don't know how can I check if the user has the album in another language:

FB.api('/me/albums', function (response)
{
for (album in response.data)
{
// Find the Profile Picture album
if (response.data[album].name == "Profile Pictures")
{
// Get a list of all photos in that album.
FB.api(response.data[album].id + "/photos", function(response)
{
// The image link
image = response.data[0].images[0].source;
});
}
}
});

Answer

This is straight from the documentation

You can specify the picture size you want with the type argument, which should be one of square (50x50), small (50 pixels wide, variable height), normal (100 pixels wide, variable height), and large (about 200 pixels wide, variable height):

http://graph.facebook.com/{ID}/picture?type=large

Now, there's nothing stopping you from calling into the graph to get larger sizes, but you have to have a valid user access token to do so.

Comments