handlers.py: NameError image_bytes->raw_bytes исправлено

This commit is contained in:
2026-08-14 11:51:56 +07:00
parent 7196fe603a
commit 55d95d3042
+2 -2
View File
@@ -261,7 +261,7 @@ async def photo_module_handler(msg: Message):
try: try:
from PIL import Image from PIL import Image
import io import io
img = Image.open(io.BytesIO(image_bytes)) img = Image.open(io.BytesIO(raw_bytes))
if img.mode != 'RGB': if img.mode != 'RGB':
img = img.convert('RGB') img = img.convert('RGB')
@@ -288,7 +288,7 @@ async def photo_module_handler(msg: Message):
# Сохраняем оригинал и координаты # Сохраняем оригинал и координаты
original_path = f"/tmp/orig_{user_login}.jpg" original_path = f"/tmp/orig_{user_login}.jpg"
with open(original_path, 'wb') as f: with open(original_path, 'wb') as f:
f.write(image_bytes) f.write(raw_bytes)
pending_photos[user_id] = { pending_photos[user_id] = {
'path': original_path, 'path': original_path,