From e916188b937bccb67706fb88117b4f49d99af1b6 Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Date: Mon, 16 Jan 2023 00:35:33 -0300 Subject: [PATCH] Fixing more telegram deseralization errors --- skynet/frontend/telegram.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/skynet/frontend/telegram.py b/skynet/frontend/telegram.py index 0872a97..c14e869 100644 --- a/skynet/frontend/telegram.py +++ b/skynet/frontend/telegram.py @@ -113,12 +113,7 @@ async def run_skynet_telegram( logging.info(result['id']) img_raw = zlib.decompress(bytes.fromhex(result['img'])) logging.info(f'got image of size: {len(img_raw)}') - meta = result['meta']['meta'] - size = (int(meta['width']), int(meta['height'])) - if meta['upscaler'] == 'x4': - size = (size[0] * 4, size[1] * 4) - - img = Image.frombytes('RGB', size, img_raw) + img = Image.open(io.BytesIO(img_raw)) await bot.send_photo( message.chat.id, @@ -164,11 +159,6 @@ async def run_skynet_telegram( logging.info(result['id']) img_raw = zlib.decompress(bytes.fromhex(result['img'])) logging.info(f'got image of size: {len(img_raw)}') - meta = result['meta']['meta'] - size = (int(meta['width']), int(meta['height'])) - if meta['upscaler'] == 'x4': - size = (size[0] * 4, size[1] * 4) - img = Image.open(io.BytesIO(img_raw)) await bot.send_photo( @@ -198,11 +188,6 @@ async def run_skynet_telegram( logging.info(result['id']) img_raw = zlib.decompress(bytes.fromhex(result['img'])) logging.info(f'got image of size: {len(img_raw)}') - meta = result['meta']['meta'] - size = (int(meta['width']), int(meta['height'])) - if meta['upscaler'] == 'x4': - size = (size[0] * 4, size[1] * 4) - img = Image.open(io.BytesIO(img_raw)) await bot.send_photo(