User uploaded image resizing
Hey,
My site is kind of like a Twitter clone. I'm wondering exactly how Twitter handles user-uploaded images and how they display them in the timeline (on mobile web and desktop).
I am using intervention/image fit() method and am saving a landscape version (->fit(600, 400)) of the image to display on the timeline. This seems to work the same way as Twitter for portrait images (such as a phone screenshot) as it crops and centres the image to fit in the landscape 600x400 dimensions. I am also saving a scaled version which is 600px width like ->widen(600) and a variable height, which appears in a lightbox.
If I upload an image to Twitter which is 321x253, it shows the full image in the timeline. But if I upload it to my site it is cropped slightly at the top and bottom. Then shows the full image in the lightbox. I'm wondering how I can make it show the full image in those dimensions on the timeline. Have tried to figure out how to handle all possible image size scenarios but I'm getting a bit overwhelmed. Help is much appreciated.
Please or to participate in this conversation.