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

use Image.LANCZOS instead of Image.ANTIALIAS for thumbnail resize #15876

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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