fix
This commit is contained in:
parent
710669cd1c
commit
cc7d8d0a86
6
main.py
6
main.py
@ -64,11 +64,11 @@ async def check_updates():
|
|||||||
thumb=post.preview.url,
|
thumb=post.preview.url,
|
||||||
caption=caption)
|
caption=caption)
|
||||||
elif post.file.ext in ('png', 'jpg'):
|
elif post.file.ext in ('png', 'jpg'):
|
||||||
file_resized = BytesIO()
|
if post.file.size > 10000000:
|
||||||
im = Image.open(file)
|
im = Image.open(file)
|
||||||
im.thumbnail((2048, 2048), Image.LANCZOS)
|
im.thumbnail((2048, 2048), Image.LANCZOS)
|
||||||
im.save(file_resized, format='JPEG')
|
file.truncate(0)
|
||||||
im.name = 'file.jpg'
|
im.save(file, format='JPEG')
|
||||||
im.seek(0)
|
im.seek(0)
|
||||||
await bot.send_photo(int(os.environ['SEND_CHAT']),
|
await bot.send_photo(int(os.environ['SEND_CHAT']),
|
||||||
file_resized,
|
file_resized,
|
||||||
|
Loading…
Reference in New Issue
Block a user