This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def download_ugoira(ugoira_zip: BytesIO, data: dict, filename: str): | |
if not data.get("ugoira_metadata"): | |
raise Exception("Not valid ugoira data") | |
delay = 0 | |
frames = [] | |
raw_frames = data["ugoira_metadata"]["frames"] | |
with zipfile.ZipFile(ugoira_zip) as file: | |
for frame in raw_frames: | |
frames.append(imageio.imread(file.read(frame["file"]))) |
![aya6.gif](https://gist.github.com/hibikidesu/6690fb9010c15bdc6c7da2e98c290270/raw/85adf36db77b50fa4a6b68dd63637e7df3c28713/aya6.gif)
![aya5.gif](https://gist.github.com/hibikidesu/1dde7ab90b97356dc240a633c5bfa849/raw/fa19667bbb7b5c20c2fc4e98019620ef3c005bf6/aya5.gif)
![aya4.gif](https://gist.github.com/hibikidesu/cb4bbdc80bf0d29beb8073a9cf699af1/raw/4e52afd0a2863e59a8252b7ad7ecce64a1593fad/aya4.gif)
![aya3.gif](https://gist.github.com/hibikidesu/3f0b5086e63a5431e369f0106b576335/raw/fc60e5e24897ae7df4ad3746b6d46fa14c66b083/aya3.gif)
![aya2.gif](https://gist.github.com/hibikidesu/b7c2db1c2de82fe953d22dba8eb0c2b1/raw/27e2dccb42380689e9b784236b8395ac65ea0227/aya2.gif)
![aya1.gif](https://gist.github.com/hibikidesu/9a7fbe537b136425a46e8b621e7727b3/raw/0881ef7f6d6d184c6855f70f37b4ed7ab1c2dad5/aya1.gif)