From 3aff450bae728e2aeee9f7ea027c1d688fed393b Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 6 Mar 2018 22:43:31 +0200 Subject: [PATCH] Fix error with large thumbnails --- mautrix_telegram/portal.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mautrix_telegram/portal.py b/mautrix_telegram/portal.py index 4b737f6e..1de1f907 100644 --- a/mautrix_telegram/portal.py +++ b/mautrix_telegram/portal.py @@ -880,7 +880,9 @@ class Portal: "mimetype": thumbnail.mime_type, "h": document.thumb.h, "w": document.thumb.w, - "size": len(document.thumb.bytes) + "size": (len(document.thumb.bytes) + if isinstance(document.thumb, PhotoCachedSize) + else document.thumb.size) } info["thumbnail_url"] = thumbnail.mxc if height and width: