diff --git a/src/pretix/helpers/thumb.py b/src/pretix/helpers/thumb.py index de0ba9bb30..aa72e9e489 100644 --- a/src/pretix/helpers/thumb.py +++ b/src/pretix/helpers/thumb.py @@ -3,7 +3,7 @@ from io import BytesIO from django.core.files.base import ContentFile from django.core.files.storage import default_storage -from PIL import Image +from PIL import Image, ImageOps from PIL.Image import LANCZOS from pretix.helpers.models import Thumbnail @@ -56,6 +56,9 @@ def create_thumbnail(sourcename, size): except: raise ThumbnailError('Could not load image') + # before we calc thumbnail, we need to check and apply EXIF-orientation + image = ImageOps.exif_transpose(image) + scale, crop = get_sizes(size, image.size) image = image.resize(scale, resample=LANCZOS) if crop: