make thumbnails smaller
This commit is contained in:
parent
78da6d6788
commit
10ea63ec40
2
main.py
2
main.py
@ -67,7 +67,7 @@ async def check_updates():
|
|||||||
if post.file.size > 10000000:
|
if post.file.size > 10000000:
|
||||||
logging.warning('compressing')
|
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((1500, 1500), Image.LANCZOS)
|
||||||
im = Image.new('RGBA', dl_im.size, (255, 255, 255))
|
im = Image.new('RGBA', dl_im.size, (255, 255, 255))
|
||||||
composite = Image.alpha_composite(im, dl_im).convert('RGB')
|
composite = Image.alpha_composite(im, dl_im).convert('RGB')
|
||||||
file.truncate(0)
|
file.truncate(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user