Skip to content
Permalink
Browse files

Ignore PhotoPathSize thumbnail sizes

Closes #1655.
  • Loading branch information
Lonami committed Dec 19, 2020
1 parent 5011747 commit dd00829f1eb8a17007bd19da3e9a02b0b99f6e99
Showing with 7 additions and 0 deletions.
  1. +7 −0 telethon/client/downloads.py
@@ -733,6 +733,13 @@ def sort_thumbs(thumb):

thumbs = list(sorted(thumbs, key=sort_thumbs))

for i in reversed(range(len(thumbs))):
# :tl:`PhotoPathSize` is used for animated stickers preview, and the thumb is actually
# a SVG path of the outline. Users expect thumbnails to be JPEG files, so pretend this
# thumb size doesn't actually exist (#1655).
if isinstance(thumbs[i], types.PhotoPathSize):
thumbs.pop(i)

if thumb is None:
return thumbs[-1]
elif isinstance(thumb, int):

0 comments on commit dd00829

Please sign in to comment.