forked from rDrama/rDrama
master
parent
c7ea305ae1
commit
f70ab8b140
|
@ -15,8 +15,8 @@ def upload_ibb(file=None, resize=False):
|
||||||
|
|
||||||
if file: file.save("image.webp")
|
if file: file.save("image.webp")
|
||||||
|
|
||||||
if resize:
|
|
||||||
i = IImage.open("image.webp")
|
i = IImage.open("image.webp")
|
||||||
|
if resize:
|
||||||
size = 100, 100
|
size = 100, 100
|
||||||
frames = ImageSequence.Iterator(i)
|
frames = ImageSequence.Iterator(i)
|
||||||
|
|
||||||
|
@ -34,6 +34,8 @@ def upload_ibb(file=None, resize=False):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
return
|
return
|
||||||
|
else: i.save("image.webp", optimize=True, quality=30)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open("image.webp", 'rb') as f:
|
with open("image.webp", 'rb') as f:
|
||||||
data={'image': base64.b64encode(f.read())}
|
data={'image': base64.b64encode(f.read())}
|
||||||
|
|
Loading…
Reference in New Issue