This commit is contained in:
bakatrouble 2023-03-30 22:15:27 +03:00
parent 8c481d2b02
commit 78da6d6788

View File

@ -65,6 +65,7 @@ async def check_updates():
caption=caption) caption=caption)
elif post.file.ext in ('png', 'jpg'): elif post.file.ext in ('png', 'jpg'):
if post.file.size > 10000000: if post.file.size > 10000000:
logging.warning('compressing')
dl_im = Image.open(file).convert('RGBA') dl_im = Image.open(file).convert('RGBA')
dl_im.thumbnail((2048, 2048), Image.LANCZOS) dl_im.thumbnail((2048, 2048), Image.LANCZOS)
im = Image.new('RGBA', dl_im.size, (255, 255, 255)) im = Image.new('RGBA', dl_im.size, (255, 255, 255))