From 53c0c731d848a6d9c5ad2194e66b432a591b84cf Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 25 Oct 2022 07:57:48 +0200 Subject: [PATCH] misc: use LANCZOS instead of PIL.Image.Antialias (#70634) PIL.Image.Antialias is deprecated. --- src/authentic2/forms/fields.py | 2 +- tox.ini | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/authentic2/forms/fields.py b/src/authentic2/forms/fields.py index 31bde746..14bf8f33 100644 --- a/src/authentic2/forms/fields.py +++ b/src/authentic2/forms/fields.py @@ -147,7 +147,7 @@ class ProfileImageField(FileField): box[3] += box[1] image = image.crop(box) - return image.resize([width, height], PIL.Image.ANTIALIAS) + return image.resize([width, height], PIL.Image.LANCZOS) class ValidatedEmailField(EmailField): diff --git a/tox.ini b/tox.ini index 73333cf0..3df154d7 100644 --- a/tox.ini +++ b/tox.ini @@ -52,9 +52,13 @@ deps = buster: django<2.3 buster: django-model-utils<4 buster: django-select2>=5,<6 +# impossible to compile old version of pillow on recent debian :/ or to install +# python3.6, the version of python on buster +# buster: pillow==5.4.1 bullseye: django<2.3 bullseye: django-model-utils<4 bullseye: django-select2>=5,<6 + bullseye: pillow==8.1.2 stable-backports: django>=3.2.12,<3.3 stable-backports: django-model-utils>=4.2,<4.3 stable-backports: django-select2>=7.7,<7.8 @@ -172,6 +176,7 @@ commands = filterwarnings = ignore once:::authentic2.* + error:.*ANTIALIAS is deprecated and will be removed in Pillow 10:: junit_family=xunit2 [coverage:run] -- 2.37.2