From db39b89ae4f68d03ca5a354e70a11e2153733af1 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 4 Apr 2022 19:14:53 +0200 Subject: [PATCH] Fix Pillow import to resolve deprecation warning --- src/pretix/helpers/thumb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pretix/helpers/thumb.py b/src/pretix/helpers/thumb.py index 532c19b4d..c7e0af868 100644 --- a/src/pretix/helpers/thumb.py +++ b/src/pretix/helpers/thumb.py @@ -26,7 +26,7 @@ from io import BytesIO from django.core.files.base import ContentFile from django.core.files.storage import default_storage from PIL import Image, ImageOps -from PIL.Image import LANCZOS +from PIL.Image import Resampling from pretix.helpers.models import Thumbnail @@ -141,7 +141,7 @@ def resize_image(image, size): image = ImageOps.exif_transpose(image) new_size, crop = get_sizes(size, image.size) - image = image.resize(new_size, resample=LANCZOS) + image = image.resize(new_size, resample=Resampling.LANCZOS) if crop: image = image.crop(crop)