soiz commited on
Commit
e85f01b
·
verified ·
1 Parent(s): f0c236a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -28,8 +28,8 @@ 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
- adjusted_loop_count = max(0, loop_count - 1) # GIFのループ設定に合わせる
33
 
34
  # 保存
35
  output_path = f"{base_name}_edited.gif"
@@ -37,7 +37,7 @@ def edit_file(file, loop_count, speed_factor, frame_skip):
37
  output_path,
38
  save_all=True,
39
  append_images=frames[1:],
40
- loop=adjusted_loop_count, # 調整後のループ回数
41
  duration=durations,
42
  disposal=2
43
  )
 
28
  frames.append(frame.copy())
29
  durations.append(original_duration // speed_factor) # 再生速度調整
30
 
31
+ # Pillowのループ設定の仕様に合わせて調整
32
+ adjusted_loop_count = 0 if loop_count == 0 else loop_count - 1
33
 
34
  # 保存
35
  output_path = f"{base_name}_edited.gif"
 
37
  output_path,
38
  save_all=True,
39
  append_images=frames[1:],
40
+ loop=adjusted_loop_count, # 修正されたループ回数
41
  duration=durations,
42
  disposal=2
43
  )