我如何从Facebook图形API获得100x100方形图片? [英] How can i get 100x100 square picture from facebook graph api?

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

问题描述

我需要从facebook图形api中获得100x100的方形图片.图片必须像标准方形"50x50"图片一样裁剪,但是尺寸必须为100x100.谢谢!

I need to get 100x100 square picture from facebook graph api. Picture must be croped like standart square "50x50" picture, but size must be 100x100. Thank you!

推荐答案

仅Graph API *提供以下大小(使用type参数指定图片大小):

The Graph API only* offers the following sizes (specify the picture size with the type argument):

  • 正方形:50x50像素

:宽50像素,高度可变

small: 50 pixels wide, variable height

普通:宽100像素,高度可变

normal: 100 pixels wide, variable height

:宽约200像素,高度可变

large: about 200 pixels wide, variable height

如果您希望图片的尺寸为100x100,则必须获取正常"尺寸并自行裁剪,例如如果您使用的是php,请检查 imagecopyresampled 函数

If you want the image to be 100x100, you will have to retrieve the "normal" size and crop it yourself, e.g. if you are using php check the imagecopyresampled function

*更新:

正如下面的评论中指出的那样,该答案在2012年5月是正确的,但如今,您还可以选择使用 graph.facebook.com/ UID 获得不同的尺寸/picture?width = N & height = N ,如Jeremy的最新答案所述.

As pointed out in the comments below, this answer was correct in May 2012, but nowadays you also have the option to get different sizes using graph.facebook.com/UID/picture?width=N&height=N, as described in the more recent answer from Jeremy.

这篇关于我如何从Facebook图形API获得100x100方形图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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