Graph API获得照片平方(100x100) [英] Graph API get photo square (100x100)

查看:89
本文介绍了Graph API获得照片平方(100x100)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用选择视图用户设置(如果使用大图像)获取facebook照片。如果我在路径图中使用type =large或normal或small,那么我得到图像,但它不是方形,它不是用户集的选择视图。所以,我如何获得与方形类型的照片,它是用户设置的视图

How can I get facebook photo with selection view user set (if they use large image). If I use type = "large" or "normal" or "small" in path graph then I get image but It's not square and It's not selection view of user set. So, how can I get photo with square type and it's view of user set

推荐答案

您可以获得更高尺寸的正方形图片比 type = square (其大小只有50x50像素)通常请求图片 width height 参数集。

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 widthand height parameters set.

请参阅 https://developers.facebook.com/docs/reference/api/user/ ,图片连接,引用:

See https://developers.facebook.com/docs/reference/api/user/, "picture" connection, quote:


此外,您可以指定宽度和高度URL参数来请求特定大小的图片。这将返回一个可用的配置文件图片最接近到请求的大小和请求的宽高比。 [...]如果width = height,我们将始终返回一个正方形图片。

"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."

示例:

https://graph.facebook.com/ 4 /图片?type = square - Zuckerberg先生的正常Square个人资料图片,大小50x50

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像素,完美匹配请求的大小

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 - 要求150x150,取而代之的是156x156。

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.

否则它会进行一些测试尝试找出是否有某些正方形图像大小,Facebook将始终具有有货,并提供完全匹配,或者如果每个用户可能会有所不同,具体取决于他们上传的图片。

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.

这篇关于Graph API获得照片平方(100x100)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆