From 59b57173469b807a594f29190aee547952e58922 Mon Sep 17 00:00:00 2001 From: lehmann Date: Fri, 11 Aug 2023 15:14:16 +0200 Subject: [PATCH] Correctif Image.ANTIALIAS --- app/scodoc/imageresize.py | 4 ++-- app/scodoc/sco_photos.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/scodoc/imageresize.py b/app/scodoc/imageresize.py index 5a5af483..93f874f0 100644 --- a/app/scodoc/imageresize.py +++ b/app/scodoc/imageresize.py @@ -6,7 +6,7 @@ from PIL import Image as PILImage def ImageScale(img_file, maxx, maxy): im = PILImage.open(img_file) - im.thumbnail((maxx, maxy), PILImage.ANTIALIAS) + im.thumbnail((maxx, maxy), PILImage.LANCZOS) out_file_str = io.BytesIO() im.save(out_file_str, im.format) out_file_str.seek(0) @@ -20,7 +20,7 @@ def ImageScaleH(img_file, W=None, H=90): if W is None: # keep aspect W = int((im.size[0] * H) / float(im.size[1])) - im.thumbnail((W, H), PILImage.ANTIALIAS) + im.thumbnail((W, H), PILImage.LANCZOS) out_file_str = io.BytesIO() im.save(out_file_str, im.format) out_file_str.seek(0) diff --git a/app/scodoc/sco_photos.py b/app/scodoc/sco_photos.py index 44acb448..467d3578 100755 --- a/app/scodoc/sco_photos.py +++ b/app/scodoc/sco_photos.py @@ -338,7 +338,7 @@ def scale_height(img, W=None, H=REDUCED_HEIGHT): if W is None: # keep aspect W = int((img.size[0] * H) / img.size[1]) - img.thumbnail((W, H), PILImage.ANTIALIAS) + img.thumbnail((W, H), PILImage.LANCZOS) return img