Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -139,11 +139,13 @@ def make_animation(url1="",url2="",url3="",url4="",url5="",url6="",url7="",url8=
|
|
| 139 |
clip = ic.ImageSequenceClip(frames, fps = fps)
|
| 140 |
|
| 141 |
|
| 142 |
-
#
|
| 143 |
-
|
| 144 |
-
clip.write_gif(
|
| 145 |
-
|
| 146 |
-
|
|
|
|
|
|
|
| 147 |
|
| 148 |
# Encode GIF bytes as base64 for HTML
|
| 149 |
gif_base64 = base64.b64encode(gif_bytes).decode('utf-8')
|
|
|
|
| 139 |
clip = ic.ImageSequenceClip(frames, fps = fps)
|
| 140 |
|
| 141 |
|
| 142 |
+
# Save GIF to a temporary file
|
| 143 |
+
temp_gif_path = f"temp_{uid}.gif"
|
| 144 |
+
clip.write_gif(temp_gif_path, fps=fps)
|
| 145 |
+
|
| 146 |
+
# Read the GIF file into bytes
|
| 147 |
+
with open(temp_gif_path, 'rb') as gif_file:
|
| 148 |
+
gif_bytes = gif_file.read()
|
| 149 |
|
| 150 |
# Encode GIF bytes as base64 for HTML
|
| 151 |
gif_base64 = base64.b64encode(gif_bytes).decode('utf-8')
|