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: