Skip to content

Commit

Permalink
Upgrade pillow (#33769)
Browse files Browse the repository at this point in the history
* build: upgrading pillow.
  • Loading branch information
awais786 authored Nov 27, 2023
1 parent 487b870 commit 9998dc5
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/profile_images/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx-sandbox/py38.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion xmodule/contentstore/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 9998dc5

Please sign in to comment.