0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-13 09:43:33 +01:00

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 <539@idlegandalf.com>
This commit is contained in:
an0nfunc 2023-07-05 10:52:12 +02:00 committed by GitHub
parent c8e81898b6
commit c303eca8cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

1
changelog.d/15876.bugfix Normal file
View file

@ -0,0 +1 @@
Correctly resize thumbnails with pillow version >=10.

View file

@ -131,7 +131,7 @@ class Thumbnailer:
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.