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

Commit

Permalink
Fix mypy against latest pillow stubs
Browse files Browse the repository at this point in the history
Fixes #12668.
  • Loading branch information
David Robertson committed May 9, 2022
1 parent 18d6c18 commit 5b62941
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions synapse/rest/media/v1/thumbnailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ def _resize(self, width: int, height: int) -> Image.Image:
#
# If the image has transparency, use RGBA instead.
if self.image.mode in ["1", "L", "P"]:
mode = "RGB"
if self.image.info.get("transparency", None) is not None:
mode = "RGBA"
self.image = self.image.convert(mode)
self.image = self.image.convert("RGBA")
else:
self.image = self.image.convert("RGB")
return self.image.resize((width, height), Image.ANTIALIAS)

def scale(self, width: int, height: int, output_type: str) -> BytesIO:
Expand Down

0 comments on commit 5b62941

Please sign in to comment.