Akjava commited on
Commit
cd30470
·
1 Parent(s): 62427e6

fix animation duration broken

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -115,7 +115,8 @@ def convert_webp_to_images(webp_path):
115
  image.seek(i)
116
  frame = image.copy()
117
  frames.append(frame)
118
- duration = getattr(frame.info,"duration",100)
 
119
  durations.append(duration)
120
  else:# webp never happen?
121
  frames.append(image)
 
115
  image.seek(i)
116
  frame = image.copy()
117
  frames.append(frame)
118
+ # frame.info must be dictionary
119
+ duration = frame.info.get("duration",100)
120
  durations.append(duration)
121
  else:# webp never happen?
122
  frames.append(image)