From 9998dc58fe33436f3bd9832e73590f9e024fd7db Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 27 Nov 2023 13:45:59 +0500 Subject: [PATCH] Upgrade pillow (#33769) * build: upgrading pillow. --- openedx/core/djangoapps/profile_images/images.py | 2 +- requirements/constraints.txt | 2 +- requirements/edx-sandbox/py38.txt | 2 +- requirements/edx/base.txt | 2 +- requirements/edx/development.txt | 2 +- requirements/edx/doc.txt | 2 +- requirements/edx/testing.txt | 2 +- xmodule/contentstore/content.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openedx/core/djangoapps/profile_images/images.py b/openedx/core/djangoapps/profile_images/images.py index 0df9ee3cba0b..ca114c3569fb 100644 --- a/openedx/core/djangoapps/profile_images/images.py +++ b/openedx/core/djangoapps/profile_images/images.py @@ -166,7 +166,7 @@ def _scale_image(image, side_length): Given a PIL.Image object, get a resized copy with each side being `side_length` pixels long. The scaled image will always be square. """ - return image.resize((side_length, side_length), Image.ANTIALIAS) + return image.resize((side_length, side_length), Image.LANCZOS) def _create_image_file(image, exif): diff --git a/requirements/constraints.txt b/requirements/constraints.txt index bb5e1cc8178c..164c4a4d6275 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -96,7 +96,7 @@ drf-yasg<1.21.6 djangorestframework<3.15.0 # tests failing with greater version. Fix this in separate ticket. -pillow<10.0.0 +pillow<10.1.0 # The version of django-stubs we can use depends on which Django release we're using # 1.16.0 works with Django 3.2 through 4.1 diff --git a/requirements/edx-sandbox/py38.txt b/requirements/edx-sandbox/py38.txt index 13edc4d5614d..28e441d7701b 100644 --- a/requirements/edx-sandbox/py38.txt +++ b/requirements/edx-sandbox/py38.txt @@ -59,7 +59,7 @@ openedx-calc==3.0.1 # via -r requirements/edx-sandbox/py38.in packaging==23.2 # via matplotlib -pillow==9.5.0 +pillow==10.0.1 # via # -c requirements/edx-sandbox/../constraints.txt # matplotlib diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 1f41384f6592..a82072e21bc7 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -841,7 +841,7 @@ pgpy==0.6.0 # via edx-enterprise piexif==1.1.3 # via -r requirements/edx/kernel.in -pillow==9.5.0 +pillow==10.0.1 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/kernel.in diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 4f1784033217..f30b3f344565 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -1413,7 +1413,7 @@ piexif==1.1.3 # via # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt -pillow==9.5.0 +pillow==10.0.1 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/doc.txt diff --git a/requirements/edx/doc.txt b/requirements/edx/doc.txt index 5b7213d3dbdd..c35a5447934b 100644 --- a/requirements/edx/doc.txt +++ b/requirements/edx/doc.txt @@ -1008,7 +1008,7 @@ picobox==3.0.0 # via sphinxcontrib-openapi piexif==1.1.3 # via -r requirements/edx/base.txt -pillow==9.5.0 +pillow==10.0.1 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/base.txt diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index eba8f4dfe393..502308d1ff79 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -1059,7 +1059,7 @@ pgpy==0.6.0 # edx-enterprise piexif==1.1.3 # via -r requirements/edx/base.txt -pillow==9.5.0 +pillow==10.0.1 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/base.txt diff --git a/xmodule/contentstore/content.py b/xmodule/contentstore/content.py index 35dfc60c47b1..16608506acef 100644 --- a/xmodule/contentstore/content.py +++ b/xmodule/contentstore/content.py @@ -445,7 +445,7 @@ def generate_thumbnail(self, content, tempfile_path=None, dimensions=None): if not dimensions: dimensions = (128, 128) - thumbnail_image.thumbnail(dimensions, Image.ANTIALIAS) + thumbnail_image.thumbnail(dimensions, Image.LANCZOS) thumbnail_image.save(thumbnail_file, 'JPEG') thumbnail_file.seek(0)