From ddc9bef503bf8da23fa5637ac176dba39fb4d74b Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 12 Nov 2023 21:12:27 +0100 Subject: [PATCH] Force filename with JPG extension after resizing Old name does not matter, since we just encoded it as JPEG --- telethon/client/uploads.py | 2 +- telethon/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/telethon/client/uploads.py b/telethon/client/uploads.py index c9aee40f..7245c098 100644 --- a/telethon/client/uploads.py +++ b/telethon/client/uploads.py @@ -90,7 +90,7 @@ def _resize_photo_if_needed( buffer = io.BytesIO() result.save(buffer, 'JPEG', progressive=True, **kwargs) buffer.seek(0) - buffer.name = getattr(file, 'name', None) + buffer.name = 'a.jpg' return buffer except IOError: return file diff --git a/telethon/version.py b/telethon/version.py index 2c8d2aba..76be3d23 100644 --- a/telethon/version.py +++ b/telethon/version.py @@ -1,3 +1,3 @@ # Versions should comply with PEP440. # This line is parsed in setup.py: -__version__ = '1.32.0' +__version__ = '1.32.1'