This commit is contained in:
Aevann1 2021-07-30 12:45:53 +02:00
parent 659f6d8b7c
commit 875e92c6e2
2 changed files with 3 additions and 1 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
image.gif
dramacache/
__pycache__/
*.py[cod]

View file

@ -16,12 +16,13 @@ def upload_file(file=None, resize=False):
if resize:
i = IImage.open("image.gif")
size = 100, 100
frames = ImageSequence.Iterator(i)
def thumbnails(frames):
for frame in frames:
thumbnail = frame.copy()
thumbnail.thumbnail(100, 100, IImage.ANTIALIAS)
thumbnail.thumbnail(size, IImage.ANTIALIAS)
yield thumbnail
frames = thumbnails(frames)