diff --git a/photo_bot/handlers.py b/photo_bot/handlers.py index 033576b..553575e 100644 --- a/photo_bot/handlers.py +++ b/photo_bot/handlers.py @@ -261,7 +261,7 @@ async def photo_module_handler(msg: Message): try: from PIL import Image import io - img = Image.open(io.BytesIO(image_bytes)) + img = Image.open(io.BytesIO(raw_bytes)) if img.mode != 'RGB': img = img.convert('RGB') @@ -288,7 +288,7 @@ async def photo_module_handler(msg: Message): # Сохраняем оригинал и координаты original_path = f"/tmp/orig_{user_login}.jpg" with open(original_path, 'wb') as f: - f.write(image_bytes) + f.write(raw_bytes) pending_photos[user_id] = { 'path': original_path,