forked from rDrama/rDrama
master
parent
70a5c27be2
commit
aa7573c493
|
@ -16,8 +16,9 @@ def upload_ibb(file=None, resize=False):
|
|||
|
||||
if file: file.save("image.webp")
|
||||
|
||||
i = IImage.open("image.webp")
|
||||
|
||||
if resize:
|
||||
i = IImage.open("image.webp")
|
||||
size = 100, 100
|
||||
frames = ImageSequence.Iterator(i)
|
||||
|
||||
|
@ -32,9 +33,9 @@ def upload_ibb(file=None, resize=False):
|
|||
om = next(frames)
|
||||
om.info = i.info
|
||||
om.save("image.webp", save_all=True, append_images=list(frames), loop=0, optimize=True, quality=30)
|
||||
else:
|
||||
gifwebp(input_image="image.webp", output_image="image.webp", option="-q 80", logging="-v")
|
||||
|
||||
else:
|
||||
if i.format.lower() == "gif": gifwebp(input_image="image.webp", output_image="image.webp", option="-q 80", logging="-v")
|
||||
else: i.save("image.webp", optimize=True, quality=30)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue