Ignore PhotoPathSize thumbnail sizes

Closes #1655.
This commit is contained in:
Lonami Exo 2020-12-19 19:42:07 +01:00
parent 5011747f1f
commit dd00829f1e

View File

@ -733,6 +733,13 @@ class DownloadMethods:
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):