有什么方法可以调整从图形 API 网址 https://graph.facebook.com/profileid/picture?type=square
检索的个人资料图片的大小吗?
我知道您可以调用的不同类型。但我需要调整存储在 cfimage
标记中的图像服务器端的大小,以便我可以以正确的大小显示它。
不幸的是,我无法找到获取实际图像的方法,因为将其作为 cfimage 标记的源时,网址未得到解析。
最佳答案
尝试这样的事情:
<cfhttp
url="https://graph.facebook.com/#USER_ID#?type=square&fields=picture"
method="get"
getasbinary="yes"
result="pic">
<cfset img = ImageNew(pic.FileContent)>
<cfif isImage(img)>
<cfimage action="resize" source="#img#" width="50">
<cfimage action="writetoBrowser" source="#img#">
<cfelse>
<img src="Default.png"/>
</cfif>
或者,您可能希望将图像保存到磁盘。
关于facebook - 调整 Facebook 个人资料图像的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9684003/