remotes/1693045480750635534/spooky-22
parent
6bb6130a28
commit
25cf0a9a27
|
@ -16,16 +16,17 @@ 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)
|
||||
|
||||
def thumbnails(frames):
|
||||
for frame in frames:
|
||||
thumbnail = frame.copy()
|
||||
if resize: thumbnail.thumbnail(size, IImage.ANTIALIAS)
|
||||
yield thumbnail
|
||||
if resize:
|
||||
size = 100, 100
|
||||
def thumbnails(frames):
|
||||
for frame in frames:
|
||||
thumbnail = frame.copy()
|
||||
: thumbnail.thumbnail(size, IImage.ANTIALIAS)
|
||||
yield thumbnail
|
||||
|
||||
frames = thumbnails(frames)
|
||||
frames = thumbnails(frames)
|
||||
|
||||
om = next(frames)
|
||||
om.info = i.info
|
||||
|
|
Loading…
Reference in New Issue