1

I want to use the pic_crop object of Profile in Facebook query language as listed in this link https://developers.facebook.com/docs/reference/fql/profile/ I activated this on my profile picture and got these results:

<fql_query_response list="true">
  <profile>
    <pic_crop>
      <uri>https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/xxxxxx_xxxxxxxx_xxxxxxxxxx_n.jpg</uri>
      <width>180</width>
      <height>173</height>
      <left>0.08468</left>
      <top>0.06897</top>
      <right>0.91532</right>
      <bottom>0.93103</bottom>
    </pic_crop>
  </profile>
</fql_query_response>

The width and the height are the sizes of the square in the big picture. Correct me if I'm wrong but I understand that the top left and bottom right are coordinates in the original big picture to locate correctly the square. I don’t understand exactly what kind of coordinates these are. How with the information of <left>0.08468</left> <top>0.06897</top> I can get to the top-left pixel in the big picture to crop the square? By the way I'm writing in PHP.

Yakir Sitbon
  • 472
  • 2
  • 8

1 Answers1

0

the left, top, right, bottom are the ratio, not absolute position.

x = width * left = 15.2424
y = height * top = 11.93181
sw = width * (right-left) = 149.5152
sh = height * (bottom -top ) = 149.13638

where sw,sh is the width and height of the square.

Eddie Lau
  • 668
  • 7
  • 12