how to compute Facebook graph api cover offset_y to pixel?

前端 未结 6 2045
故里飘歌
故里飘歌 2020-12-17 05:54

I can retrieve facebook cover source and offset_y from graph api for example -

https://graph.facebook.com/Inna

I get this -

\"cover\": {
           


        
6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-17 06:39

    MoXplod, are you sure about it?

    From my experience the offset is a % of the invisible part of the image (aka the part that doesn't fit in the window).

    For example: offset = 51 facebook cover photo size (web) = 851X315 scaled image size = 851X1135 top= -420px.

    So top = 51% * (1135-315).

    I have tried it with many diffrent cover photos of different sizes.

提交回复
热议问题