From c0828f590fb789933e8629b9ff2ed277c193a496 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Tue, 2 Apr 2019 08:59:35 +0200 Subject: [PATCH] Fix resize if needed not seeking back for image = bytes --- telethon/client/uploads.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/client/uploads.py b/telethon/client/uploads.py index 6f4edd04..a5eed2a4 100644 --- a/telethon/client/uploads.py +++ b/telethon/client/uploads.py @@ -39,7 +39,7 @@ def _resize_photo_if_needed( or (isinstance(file, io.IOBase) and not file.seekable())): return file - before = file.tell() if isinstance(file, io.IOBase) else None + before = file.tell() if isinstance(file, io.IOBase) else 0 if isinstance(file, bytes): file = io.BytesIO(file)