facebook graph api: understanding offset_y offset_x API - facebook

Hello I am trying to understand what offset_y means in facebooks graph API https://developers.facebook.com/docs/graph-api/reference/cover-photo/.
y_offset: When greater than 0% but less than 100%, the cover photo overflows
vertically. The value represents the vertical manual offset (the
amount the user dragged the photo vertically to show the part of
interest) as a percentage of the offset necessary to make the photo
fit the space.
I have tried using the solution in facebook graph api: offset_y offset_x,
but it does work.
for example, this event https://www.facebook.com/events/164312630996898/. The event picture has a css top offset of -3px:
In order to calculate this, I will attempt to use the method in facebook graph api: offset_y offset_x
The image is 500x622px (when resized to fit), the event image space is 500x262px. 622px-262px = 360px. using the facebook graph API (https://developers.facebook.com/tools/explorer?method=GET&path=164312630996898%3Ffields%3Dcover&version=v2.12) gives an offset-y of 9:
so 9% of 360px is, 32.4px, but the actual answer should be 3px.
any help would be greatly appreciated!

So I have experimented with this a lot and I am 100% sure the offset_x, offset_y are not properly documented and may not be even sufficient in many cases to even depict the offset
In my case I used two images listed below and did some experiment with different drags
The event was created on
https://www.facebook.com/events/901430313369669/
And data collected was below for the above 2 images
For the 2nd image you can see that whether i kept the image left aligned, right aligned or center aligned the offset were always 0. But the left was still calculated. This means facebook is not share the offset information correctly. It is most probably a bug based on observation from second image.
Also weird thing is the -77, 177 entries from the first image

Related

Flutter - Row items space increases with the page zoom in case of Border

I think there is a bug in Row and Column in flutter as you can see from the image attached below. I was creating a custom calendar and noticed that there is a small space between some items that varies with the screen resolution. So i tested it on the Web with the built in layout editor and i found the same bug.
If i change my page zoom the space comes and goes according to my zoom percentage as you can see the picture.
I need the solution to this problem as i am stuck on this last problem.

Area measurement of fluorescent powder from finger contacts - batch processing

I have 120 photos like the one below showing the amount of fluorescent powder deposited onto a surface when it is touched by fingers. The photo is taken under UV light. You can see 5 finger prints and the reflection from the light source.
I'd like to know if there is an automated way of estimating the area of the fluorescent finger prints in batch mode. We have been using image J to manually select a particular print and estimate the area. Is it possible to automatically recognise the fingerprint in imageJ and measure it for all 5 prints on each of the 120 photos?
Note: Clearly you can see the print on the right is quite well defined but the one of the left is quite diffuse.
First, the data is useless without a scale, and the photos will be hard to process without a fixed set-up. I'd spend time to make a photo set up that minimizes glare and doesn't change scale, then try approaching the problem using the Threshold tool to find the prints, make selections using the resulting mask, then measuring the area. I'd then create a macro to batch process them.

Facebook, opengraph, how do they crop?

I have a website, with a simple 500x500 image listed appropriately in the <meta property="og:image" content="image.jpg" />
Facebook will sometimes crop and use the top of the image, the middle or in some cases the bottom to get it's required aspect ratio out of it. Is there anything I can do to control this? Or better yet, get it to take the entire square image in like every other social networking site does?
In my findings if your image is not 600x315 1200x630 or other 40:21 ratio facebook has a three step algorithm for determining what to crop as outlined below.
FINDINGS:
First Priortiy: Face detection. Detects center point of faces. If
multiple faces determines the ones that are closest together and bases
the crop on that.
Second Priority: Some sort of contrast detection: Detail > Colors >
Contrast. So if you had a picture of a face on the top of an image and
the rest of the image was blurred out because the picture was taken
with an extremely low aperture. Then, if you have a lot of colors in a
certain part of an image it would favor that and then if there was a
really dark image that had a bright white watermark in the bottom
right hand corner it would favor that.
Third Priority: This is more of a default, if the above two don't
work, it defaults to a center crop.
After researching on facebook I found this article about what image sizes and aspect ratio are recommended by facebook.
I haven't tried this personally, but this StackOverflow question says they have already tried what facebook recommended in the article.
I will try implementing image sizes recommended on facebook and will edit the answer appropriately.
Hope this helps.

Does Facebook expose the offset positioning for cropping a larger version of a user's profile thumbnail?

I've recently noticed that in the layouts for the new Timeline profile, Facebook is using the "normal" version (read: larger) of the user's profile image extensively, both on the Timeline and in the Friends List. As we all know, this image is retrieved by querying the graph with:
https://graph.facebook.com/[userid]/picture?type=normal
Of course, this image isn't a guaranteed square crop. However, Facebook uses element-level CSS to position and crop it manually (see image below). The positioning is interesting in that it's seemingly generated before page render.
See:
Notice how there's an element-level CSS style applied. In this case it's a top offset:
style="top:-50%"
I'm assuming that this is pulling the arbitrary offset/positioning value from somewhere (the graph, a db, etc.), not using some client-side JS for facial detection, since the process of setting a new Facebook profile picture (usually) involves manually cropping your face. See it for yourself: change your profile picture and if the proportions aren't square-ish, there's an intermediate, manual cropping step.
Furthermore, this image is posted to /photo.php with the x, y, width, height, and other various parameters passed. I know some of that is used to generate the 50x50 square crop, but it also has to be stored somewhere else, correct?
My question is whether or not Facebook currently exposes a method to retrieve these offset values so we can accurately square-crop the larger profile pictures without having to rely on facial recognition or client-side processing to guarantee that the subject is centered.
Answering my own question here.
Looking at http://developers.facebook.com/docs/reference/fql/profile/ I noticed it's possible to get the following with an FQL query to the profile table:
pic_crop| string
The URL to the largest-sized square profile picture for the object
being queried. The image is at least 100px in width. This URL may be
blank.
My emphasis on that last bit.
The response looks like this:
<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>
Voila: Image size and crop positioning. The only caveat, naturally, is that last bit in bold. The URL might be blank.
Say hello to Shakira.
As you can see, the smallest one is crop version (manual + face recognition), it is easy to calculate relative position in middle image, when you have X & Y coordinates and W & H, they probably store it in database, and calculate percentage, server side. So far, I haven't seen they offer something like that. You can eventually calculate it with only these images, but that will cost you. Set background image to center center and hope for the best :)
I'm facing the same problem. pic_crop as for documentation contains the pixel co-ordinates of the user selected crop for this profile picture.
It means that if the user hasn't selected a 160x160 crop, you will get a portrait or landscape.
This is confirm by the data that I'm receiving from my tests:
{
"uri": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/xxxxxxxxx_n.jpg",
"width": 180,
"height": 286,
"left": 0,
"top": 0,
"right": 1,
"bottom": 1
}
From these information I can't understand how to make a 160x160 proper crop centering the face

What is the Fb.ui feed picture size limits?

I'm using the Fb.ui feed and I'm trying to find the picture size limits/requirements. Not all of my images appear using the feed, and I'd like to know exactly what the image requirements are. This is not well documented.
I'm pretty sure the open graph image rules apply:
An image URL which should represent your object within the graph. The
image must be at least 50px by 50px and have a maximum aspect ratio of
3:1. We support PNG, JPEG and GIF formats. You may include multiple
og:image tags to associate multiple images with your page.
What is the size of the image you are unable to post?
From my testing, the max size is 320x320. It'll keep your aspect ratio within those bounds.