Fix stripped image downloads (#1165)

This commit is contained in:
YoilyL
2019-04-25 19:31:52 +01:00
committed by Lonami
parent 19664cd9cf
commit b0e96b2821
2 changed files with 19 additions and 1 deletions

View File

@@ -344,7 +344,9 @@ class DownloadMethods(UserMethods):
f = file
try:
f.write(size.bytes)
f.write(utils.stripped_photo_to_jpg(size.bytes)
if isinstance(size, types.PhotoStrippedSize)
else size.bytes)
finally:
if isinstance(file, str):
f.close()