Open zhgabor opened 7 years ago
I'm trying to figure out something like this, too.
If i have an image that's 560x960 I would like to scale it to 1080x1080.
But what happens is that the scale
processor will scale up the image until the height is 1080 but the width would still be less than 1080.
If I'm understanding you correctly the idea is to add whitespace (or whatever background color you want) to fit the actual size you want, right?
I'm working on a custom tumbnail processor for this but was wondering if there's already a solution for this?
we have exactly similar case where we need to generate Facebook\Tweeter meta-images for e-commerce products. We need aspect ratio ~2:1 and size ~1200x630 with empty space filled with background.
Btw for those ultimately looking for this functionality sorl-thumbnail can do this https://sorl-thumbnail.readthedocs.io/en/latest/template.html?highlight=padding#padding
easy-thumbnails can do that too: you have to set a background
color for the space to be filled in in the processor configuration.
I have not found anything besides to define a CUSTOM THUMBNAIL PROCESSOR to
make images to scale down proportionally and then scale long edge to fit the size then fill it with backgroundcolor
like this