Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed May 30, 2024
1 parent 157e743 commit 04f98cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/sticker_convert/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@ def _frames_import_pillow(self) -> None:
# Pillow is not reliable for getting webp frame durations
durations: Optional[List[int]]
if im.format == "WEBP":
_, _, _, durations = CodecInfo._get_file_fps_frames_duration_webp(self.in_f)
_, _, _, durations = CodecInfo._get_file_fps_frames_duration_webp(
self.in_f
)
else:
durations = None

Expand All @@ -454,7 +456,9 @@ def _frames_import_pillow(self) -> None:
im.seek(frame)

if durations is None:
next_frame_start_duration += cast(int, im.info.get("duration", 1000))
next_frame_start_duration += cast(
int, im.info.get("duration", 1000)
)
else:
next_frame_start_duration += durations[frame]
else:
Expand Down
4 changes: 3 additions & 1 deletion src/sticker_convert/utils/media/codec_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def get_file_fps_frames_duration(
else:
duration = 0
elif file_ext == ".webp":
fps, frames, duration, _ = CodecInfo._get_file_fps_frames_duration_webp(file)
fps, frames, duration, _ = CodecInfo._get_file_fps_frames_duration_webp(
file
)
elif file_ext in (".gif", ".apng", ".png"):
fps, frames, duration = CodecInfo._get_file_fps_frames_duration_pillow(file)
else:
Expand Down

0 comments on commit 04f98cd

Please sign in to comment.