Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
use Image.LANCZOS instead of Image.ANTIALIAS for thumbnail resize
Browse files Browse the repository at this point in the history
Image.ANTIALIAS is not defined in current pillow releases. Since ANTIALIAS was just using LANCZOS anyways, this is just a cosmetic change, but makes synapse work with most recent pillow releases.

Signed-off-by: Giovanni Harting <[email protected]>
  • Loading branch information
an0nfunc committed Jul 4, 2023
1 parent 670d590 commit 9f6735f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/15876.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correctly resize thumbnails with pillow version >=10.
2 changes: 1 addition & 1 deletion synapse/media/thumbnailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _resize(self, width: int, height: int) -> Image.Image:
else:
with self.image:
self.image = self.image.convert("RGB")
return self.image.resize((width, height), Image.ANTIALIAS)
return self.image.resize((width, height), Image.LANCZOS)

def scale(self, width: int, height: int, output_type: str) -> BytesIO:
"""Rescales the image to the given dimensions.
Expand Down

0 comments on commit 9f6735f

Please sign in to comment.