From c64fcdb3028351ea3e61a67406fff466e256c3ce Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Mon, 7 Aug 2023 08:24:20 +0200 Subject: [PATCH] It's Image.Resampling.* now --- CHANGELOG.rst | 1 + feincms/templatetags/feincms_thumbnail.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4868abc8..efbf1190 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -12,6 +12,7 @@ Change log This enables easier interoperability of FeinCMS content types with feincms3 plugins. - Added Python 3.11. +- Fixed the Pillow resampling constant. `v23.1.0`_ (2023-03-09) diff --git a/feincms/templatetags/feincms_thumbnail.py b/feincms/templatetags/feincms_thumbnail.py index 2c774406..9f1b9d5d 100644 --- a/feincms/templatetags/feincms_thumbnail.py +++ b/feincms/templatetags/feincms_thumbnail.py @@ -122,7 +122,7 @@ def generate(self, storage, original, size, miniature): w, h = int(size["w"]), int(size["h"]) format = image.format # Save format for the save() call later - image.thumbnail([w, h], Image.ANTIALIAS) + image.thumbnail([w, h], Image.Resampling.LANCZOS) buf = BytesIO() if format.lower() not in ("jpg", "jpeg", "png"): format = "jpeg" @@ -182,7 +182,7 @@ def generate(self, storage, original, size, miniature): y_offset + int(crop_height), ) ) - image = image.resize((dst_width, dst_height), Image.ANTIALIAS) + image = image.resize((dst_width, dst_height), Image.Resampling.LANCZOS) buf = BytesIO() if format.lower() not in ("jpg", "jpeg", "png"):