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

Commit c303eca

Browse files
authored
use Image.LANCZOS instead of Image.ANTIALIAS for thumbnail resize (#15876)
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]>
1 parent c8e8189 commit c303eca

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog.d/15876.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Correctly resize thumbnails with pillow version >=10.

synapse/media/thumbnailer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def _resize(self, width: int, height: int) -> Image.Image:
131131
else:
132132
with self.image:
133133
self.image = self.image.convert("RGB")
134-
return self.image.resize((width, height), Image.ANTIALIAS)
134+
return self.image.resize((width, height), Image.LANCZOS)
135135

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

0 commit comments

Comments
 (0)