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 (#1…
Browse files Browse the repository at this point in the history
…5876)

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 <539@idlegandalf.com>
  • Loading branch information
an0nfunc authored Jul 5, 2023
1 parent c8e8189 commit c303eca
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 c303eca

Please sign in to comment.