Skip to content

Commit

Permalink
It's Image.Resampling.* now
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Aug 7, 2023
1 parent 2b9ffbe commit c64fcdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions feincms/templatetags/feincms_thumbnail.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"):
Expand Down

0 comments on commit c64fcdb

Please sign in to comment.