A
A
avigmati2015-04-16 06:11:26
Django
avigmati, 2015-04-16 06:11:26

Why does easy_thumbnails rotate the image 90 degrees?

I am using django-cms 3.0.12, django-filer 0.9.9, easy-thumbnails 2.2, Pillow 2.8.0.
In template:

{% thumbnail image_file 200x200 as thumb %}
<img style="width: 100%;" src={{ thumb.url }} />

If the original image is in portrait orientation, thumb is created landscape, i.e. rotated 90 degrees.
In the Jungi admin panel, the preview behaves the same way.
Why is that? How to avoid it?
upd.
As noted below, the matter turned out to be in exif data. Removing exif did this:
pip install pixif

models.py
import piexif
from filer.models import Image

class ItemImage(models.Model):
    apartment = models.ForeignKey(Apartment)
    image_file = FilerImageField()

    @receiver(post_save, sender=Image)
    def remove_exif(sender, instance, created, **kwargs):
        piexif.remove(instance.path)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
marazmiki, 2015-04-16
@avigmati

Probably, there are EXIF ​​tags in the original image?

A
avigmati, 2015-04-16
@avigmati

yes, I have

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question