B
B
blazer052018-09-21 14:00:56
Django
blazer05, 2018-09-21 14:00:56

How to compress an image in django easy_thumbnails?

Tell me how to compress an image proportionally to 200x200 px using django easy_thumbnails ?
In general, it is necessary that easy_thumbnails does not crop the image to the dimensions that I indicated, but make a preview from a large image into a small copy?
Now I have this:

THUMBNAIL_ALIASES = {
    '': {
        'images': {'size': (200, 200), 'crop': True, 'quality': 99},
    },
}

and in the template {{ slider.images|thumbnail_url:'images' }} everything works only cuts the image and does not reduce proportionally.
Did it like this
<img class="primary-img" src="{{ prod.images.url }}" alt="Product" style="width: 190px; height: 150px">

but then the picture is highly compressed. In general, I'm already tired of the help with the pictures, help me figure out how to properly fit all the images so that they scale regardless of their size.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
planc, 2018-09-21
@planc


everything works only cuts the picture
'crop': True
crop - crop

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question