Facebook PHP SDK: Getting (cropped) album cover

别说谁变了你拦得住时间么 提交于 2019-12-11 06:15:54

问题


I am using Facebook's PHP SDK and Graph API to obtain all albums from one user, and then display them to him so he can select which album he will browse. I want them displayed in a grid, just like Facebook does: every picture with the same width and height.

The problem is that when I do:

   $fb->api('/' . $album_id . '/picture?access_token=' . $accessToken 

I get a version of the picture with the original dimensions, and not the way that Facebook shows them to you when you click on Photos, i.e. a cropped version adjusted to a fixed size.

I have tried adding ?square to the request, but still getting the same result.

Any ideas?


回答1:


Supported types for albums are thumbnail, small and album and to retrieve one of them you use:

$fb->api('/' . $album_id . '/picture?type=album&access_token=' . $accessToken 


来源:https://stackoverflow.com/questions/5169543/facebook-php-sdk-getting-cropped-album-cover

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!