remotes/1693045480750635534/spooky-22
parent
6bb6130a28
commit
25cf0a9a27
|
@ -16,13 +16,14 @@ def upload_ibb(file=None, resize=False):
|
||||||
if file: file.save("image.webp")
|
if file: file.save("image.webp")
|
||||||
|
|
||||||
i = IImage.open("image.webp")
|
i = IImage.open("image.webp")
|
||||||
size = 100, 100
|
|
||||||
frames = ImageSequence.Iterator(i)
|
frames = ImageSequence.Iterator(i)
|
||||||
|
|
||||||
|
if resize:
|
||||||
|
size = 100, 100
|
||||||
def thumbnails(frames):
|
def thumbnails(frames):
|
||||||
for frame in frames:
|
for frame in frames:
|
||||||
thumbnail = frame.copy()
|
thumbnail = frame.copy()
|
||||||
if resize: thumbnail.thumbnail(size, IImage.ANTIALIAS)
|
: thumbnail.thumbnail(size, IImage.ANTIALIAS)
|
||||||
yield thumbnail
|
yield thumbnail
|
||||||
|
|
||||||
frames = thumbnails(frames)
|
frames = thumbnails(frames)
|
||||||
|
|
Loading…
Reference in New Issue