I run an app that let’s users design images to tweet out (eg. put text and filters on an image they upload)
Since only part of the image is visible (526x260), I’m trying to figure out how Twitter aligns them
It seems like if I upload an image with a ratio of 2:1, no
margin-top is assigned
However other times,
margin-top properties are
I’d love to know the algorithm they/you are using to determine how much to “pull up” the image by
I tried applying an exponential regression (since the pattern seems exponential) to the data points I’ve stumbled on, but unfortunately, it seems like the data points are themselves being rounded before I receive them, so I’m not able to find the pattern.
Here are the data points I’ve found
Ratio represents the ratio of the image that is uploaded; margin-top represents that the number of pixels the image is “pulled up” by
Ratio: 6 margin-top: 0 Ratio: 3 margin-top: 0 Ratio: 2 margin-top: 0 Ratio: 6/4 margin-top: -42 Ratio: 6/5 margin-top: -84 Ratio: 6/6 margin-top: -126 Ratio: 6/7 margin-top: -168 Ratio: 6/8 margin-top: -210 Ratio: 6/9 margin-top: -253 Ratio: 6/10 margin-top: -295 Ratio: 6/11 margin-top: -337 Ratio: 6/12 margin-top: -379
Thanks for any help!