forked from rDrama/rDrama
master
parent
4e3de2d942
commit
8fc19efa54
|
@ -34,12 +34,14 @@ def upload_ibb(filepath=None, file=None, resize=False):
|
||||||
|
|
||||||
om = next(frames)
|
om = next(frames)
|
||||||
om.info = i.info
|
om.info = i.info
|
||||||
|
filepath = f"image.{i.format}"
|
||||||
try: om.save(filepath, save_all=True, append_images=list(frames), loop=0, optimize=True, quality=30)
|
try: om.save(filepath, save_all=True, append_images=list(frames), loop=0, optimize=True, quality=30)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
return
|
return
|
||||||
elif format != "gif":
|
elif format != "gif":
|
||||||
i = IImage.open(filepath)
|
i = IImage.open(filepath)
|
||||||
|
filepath = f"image.{i.format}"
|
||||||
i.save(filepath, optimize=True, quality=30)
|
i.save(filepath, optimize=True, quality=30)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -84,12 +86,14 @@ def upload_imgur(filepath=None, file=None, resize=False):
|
||||||
|
|
||||||
om = next(frames)
|
om = next(frames)
|
||||||
om.info = i.info
|
om.info = i.info
|
||||||
|
filepath = f"image.{i.format}"
|
||||||
try: om.save(filepath, save_all=True, append_images=list(frames), loop=0, optimize=True, quality=30)
|
try: om.save(filepath, save_all=True, append_images=list(frames), loop=0, optimize=True, quality=30)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
return
|
return
|
||||||
elif format != "gif":
|
elif format != "gif":
|
||||||
i = IImage.open(filepath)
|
i = IImage.open(filepath)
|
||||||
|
filepath = f"image.{i.format}"
|
||||||
i.save(filepath, optimize=True, quality=30)
|
i.save(filepath, optimize=True, quality=30)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue