SmileyChris / easy-thumbnails

Easy thumbnails for Django
http://easy-thumbnails.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1.39k stars 319 forks source link

Is there a way of doing a stretch resize on the image? #464

Closed aqt01 closed 7 years ago

aqt01 commented 7 years ago

Hello!

I've using easy_thumbnail for a while and reviewed the documentation, but still cannot find a way of resizing the image without cropping it. I want to achieve a resize of images even if they looks stretched Sometimes after the resize of the picture it only fits one dimension. For ex. if i want a image of (619,372). It returns (619,310) or (710,372).

Right now i'm using this code:

get_thumbnailer(self.img).get_thumbnail(THUMBNAIL_ALIASES['tablet_featured'])

And below my THUMBNAIL_ALIASES:

THUMBNAIL_ALIASES = { 'target': { 'tablet_featured': {'size': (619, 372), 'crop': False },
'mobile_featured': {'size': (320, 336), 'crop': False }, }

Any idea of how i can achieve this?

SmileyChris commented 7 years ago

No, you can't unproportionally stretch the image.

Try fitting the image to the dimensions and do your own forced stretch with css.