Forem Creators and Builders 🌱

Cover image for We can do much more with the resizing of images.
Akhil Naidu
Akhil Naidu

Posted on

We can do much more with the resizing of images.

What is the need of Resizing images, if they were not utilised? It might save us some data, but it can also be help us leverage the potential of programmed resizing to make the site look more clean.

How I look at the structure.

In Forem cloud, initially the images are uploaded to the VPS and stored within it. Then while fetching the images they use imgproxy and resize images.

While the same process is a bit different in Dev. Dev uses a gem file s3 Direct Upload as Heroku doesn't support Persistent storage and uses Cloudinary Plugin(Imagga) to resize images.

The difference between the uploaded image and resized image.
Upload Image URL
Cropped Image URL

Issue to raise.

Even though the image was being resized successfully, the resized image was being re-cropped by the cover-pic/feature image.


If the scale of resizing and cropping would be of same scale or maintain same aspect ratio, the images would look much prettier.

In case of abstract images, the feature image would not be a concern(like the cover image of this post); but if the cover image holds essential information, like in this post, the user should would focus on editing image for himself(based on the cover-image scaling factos).

As we are already using image resizing and image caching, let's take advantage of it to resize the cover image to the correct size and display the resized image.

Top comments (1)

Collapse
 
ben profile image
Ben Halpern

We have some configuration coming down the pike to allow for communities to adjust the settings on how they handle cover images. Some can maintain the current strict crop-to-1000x420 ratio, but others will be able to allow for more flexibility.

You'll be able to set the upper limits for the needs of your community. We've made the constraint on DEV that cover images are not central content and therefore are limited as they are, but other communities will be allowed variation on this front.