请说明FQL配置文件表pic_crop [英] Please explain FQL profile table pic_crop
问题描述
查询pic_crop返回的坐标是什么意思,当与个人资料图片相关时。我已经尝试过这个工作,无法理解!
What do the coordinates returned by querying pic_crop mean when related to a profile picture. I have tried working this one out by cannot figure it!
请帮助!
顶部,右侧和底部是一个十进制,例如离开0.20115。 0.20115是什么意思?如果您查看Facebook个人资料的源代码,您将看到Facebook正在使用百分比来抵消个人资料照片。 0.20115如何翻译为Facebook的style =left:-23.13%;
The values for left, top, right and bottom are a decimal like e.g. left 0.20115. What does 0.20115 mean? If you look at the source code for a facebook profile you will see that facebook is using a percentage to offset the profile photo. How does 0.20115 translate to facebook source of style="left:-23.13%;"
推荐答案
从我朋友的个人资料中查看 pic_crop
的几个例子,似乎左,右,上,下的数字是图片总宽度的百分比。例如,我的个人资料图片返回以下值:
Looking at a few examples of pic_crop
from my friends' profiles, it seems like the left, right, top, bottom figures are percentages of the picture's total width. For example, my profile picture returns the following values:
"width": 180,
"height": 161,
"left": 0.11466,
"top": 0.06897,
"right": 0.88534,
"bottom": 0.93103
检查Facebook时间轴,配置文件图片显示为160px。 Facebook不会裁剪照片显示,而是将其缩放到160px方形窗口后面的裁剪区域,然后将照片放置在该窗口下方,以便裁剪照片。
Inspecting the Facebook timeline, the profile picture is shown square at 160px. Facebook doesn't crop the photo to show it, rather they scale it to fit the cropped area behind a 160px square window and then position the photo under that window to allow the cropped photo to show.
顶部的顶部和底部值:0.6897和底部:0.93103似乎等于无垂直作物。我可以看到我的照片和其他几个朋友的照片。因此,0.93193 - 0.06897 = 0.86206表示使用照片高度的100%。 (当没有水平作物时,相同的值适用于左侧和右侧。)
The "top" and "bottom" values of top: 0.6897 and bottom: 0.93103 seem to equate to "no vertical crop". I can see this on my photo and several other friends' photos. So, 0.93193 - 0.06897 = 0.86206 means that 100% of the height of the photo is used. (The same values work for left and right when there is no horizontal crop.)
我的照片中有一个水平裁剪。对于我的照片中的左右数字,公式似乎是:(右 - 左)&分; (0.93103-0.06897)。对于我的照片,这可以达到0.89400。所以,160&次180/161 = 179px× 0.89400 = 160px。我尝试过这样的一些其他朋友的照片,这是有效的。将右上角替换为顶部 - 底部也似乎适用于垂直裁剪的照片。
There is a horizontal crop on my photo. For the left and right figures on my photo, the formula seems to be: (right - left) ÷ (0.93103-0.06897). For my photo this works out to 0.89400. So, 160 × 180 / 161 = 179px × 0.89400 = 160px. I tried this on a few other friends' photos, and this works. Replacing "right - left" with "top - bottom" also seems to work for photos with a vertical crop.
在我的Facebook时间轴上,我的封面照片img标签被样式左:-5.93%;
。我有相同数量的左右作物,所以这应该是9.5px在一边。 9.5 / 160 = 5.93%。
On my Facebook timeline, my cover photo img tag is styled left:-5.93%;
. I've got equal amounts of left and right crop, so this should be 9.5px on a side. 9.5 / 160 = 5.93%.
我还没有解开非正规作物的缩放。
I haven't unraveled the scaling for asymetrical crops yet.
当Facebook让它变得容易因为你喜欢这样!
Gotta love it when Facebook makes it easy for you like this!
更新
只需阅读今晚的开发者的博文,还有一个获取裁剪配置文件照片的备用方法: profile_pic
表。
Just read tonight's developer's blog post and there is an alternate method for getting cropped profile photos: The profile_pic
table.
SELECT url, real_width, real_height FROM profile_pic
WHERE id = me()
AND width=160
AND height=160
返回的 url
具有根据您指定的宽度
和 height
,或多或少裁剪为个人资料所有者的意图。
The returned url
has a profile photo scaled according to your specified width
and height
and is cropped, more or less, to the profile owner's intent.
这篇关于请说明FQL配置文件表pic_crop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!