forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-09-11 05:16:10 +02:00
parent 2d2828f8db
commit 778f1affac
1 changed files with 4 additions and 1 deletions

View File

@ -68,9 +68,12 @@ def upload_imgur(filepath=None, file=None, resize=False):
if resize:
i = IImage.open(filepath)
format = i.format
i = IImage.open(filepath).convert("RGBA")
size = 100, 100
frames = ImageSequence.Iterator(i)
def thumbnails(frames):
for frame in frames:
new_image = IImage.new("RGBA", frame.size, "WHITE")
@ -83,7 +86,7 @@ def upload_imgur(filepath=None, file=None, resize=False):
om = next(frames)
om.info = i.info
filepath = f"image.{i.format}"
filepath = f"image.{format}"
try: om.save(filepath, save_all=True, append_images=list(frames), loop=0, optimize=True, quality=30)
except Exception as e:
print(e)