resolve warnings

This commit is contained in:
thomas girod
2024-06-26 12:28:00 +02:00
parent 75bb3f992c
commit cd58d5a357
6 changed files with 27 additions and 25 deletions

View File

@ -28,6 +28,7 @@ from django.conf import settings
from django.core.files.base import ContentFile
from django.utils import timezone
from PIL import ExifTags
from PIL.Image import Resampling
def get_git_revision_short_hash() -> str:
@ -109,7 +110,8 @@ def resize_image(im, edge, format):
(w, h) = im.size
(width, height) = scale_dimension(w, h, long_edge=edge)
content = BytesIO()
im = im.resize((width, height), PIL.Image.ANTIALIAS)
# use the lanczos filter for antialiasing
im = im.resize((width, height), Resampling.LANCZOS)
try:
im.save(
fp=content,