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")
|
||||
|
||||
i = IImage.open("image.webp")
|
||||
size = 100, 100
|
||||
frames = ImageSequence.Iterator(i)
|
||||
|
||||
if resize:
|
||||
size = 100, 100
|
||||
def thumbnails(frames):
|
||||
for frame in frames:
|
||||
thumbnail = frame.copy()
|
||||
if resize: thumbnail.thumbnail(size, IImage.ANTIALIAS)
|
||||
: thumbnail.thumbnail(size, IImage.ANTIALIAS)
|
||||
yield thumbnail
|
||||
|
||||
frames = thumbnails(frames)
|
||||
|
|
Loading…
Reference in New Issue