fdfd
This commit is contained in:
parent
659f6d8b7c
commit
875e92c6e2
2 changed files with 3 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
image.gif
|
||||
dramacache/
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue