From 48bcc91582bc7641a98dc38f664adceefcddc922 Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 30 Oct 2019 05:34:32 -0400 Subject: [PATCH] Never upscale images when thumbnailing --- src/python/matrix_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/python/matrix_client.py b/src/python/matrix_client.py index 343de3d3..21471762 100644 --- a/src/python/matrix_client.py +++ b/src/python/matrix_client.py @@ -402,7 +402,8 @@ class MatrixClient(nio.AsyncClient): if small and is_jpg_png and not opaque_png: raise UneededThumbnail() - thumb.thumbnail((512, 512)) + if not small: + thumb.thumbnail((512, 512)) with io.BytesIO() as out: if thumb.mode == "RGBA":