Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -28,15 +28,15 @@ def edit_file(file, loop_count, speed_factor, frame_skip):
|
|
28 |
frames.append(frame.copy())
|
29 |
durations.append(original_duration // speed_factor) # 再生速度調整
|
30 |
|
31 |
-
#
|
32 |
output_path = f"{base_name}_edited.gif"
|
33 |
frames[0].save(
|
34 |
output_path,
|
35 |
save_all=True,
|
36 |
append_images=frames[1:],
|
37 |
-
loop=loop_count
|
38 |
duration=durations,
|
39 |
-
disposal=2
|
40 |
)
|
41 |
|
42 |
return output_path, output_path
|
|
|
28 |
frames.append(frame.copy())
|
29 |
durations.append(original_duration // speed_factor) # 再生速度調整
|
30 |
|
31 |
+
# メタデータリセット&保存
|
32 |
output_path = f"{base_name}_edited.gif"
|
33 |
frames[0].save(
|
34 |
output_path,
|
35 |
save_all=True,
|
36 |
append_images=frames[1:],
|
37 |
+
loop=loop_count, # ループ回数(0は無限ループ、1は1回ループ)
|
38 |
duration=durations,
|
39 |
+
disposal=2 # 各フレームを上書きする設定
|
40 |
)
|
41 |
|
42 |
return output_path, output_path
|