This commit is contained in:
bakatrouble 2023-03-30 20:51:22 +03:00
parent 02e5eeb7d5
commit 710669cd1c

View File

@ -66,12 +66,12 @@ async def check_updates():
elif post.file.ext in ('png', 'jpg'): elif post.file.ext in ('png', 'jpg'):
file_resized = BytesIO() file_resized = BytesIO()
im = Image.open(file) im = Image.open(file)
im.thumbnail((2048, 2048), Image.ANTIALIAS) im.thumbnail((2048, 2048), Image.LANCZOS)
im.save(file_resized, format='JPEG') im.save(file_resized, format='JPEG')
im.name = 'file.jpg' im.name = 'file.jpg'
im.seek(0) im.seek(0)
await bot.send_photo(int(os.environ['SEND_CHAT']), await bot.send_photo(int(os.environ['SEND_CHAT']),
im, file_resized,
caption=caption) caption=caption)
await redis.sadd('e621:sent', post.id) await redis.sadd('e621:sent', post.id)
except exceptions.TelegramAPIError as e: except exceptions.TelegramAPIError as e: