Skip to content

Commit

Permalink
fix: static images have 1 frame, not 0
Browse files Browse the repository at this point in the history
  • Loading branch information
xjcl committed Jun 16, 2020
1 parent 3dfc0a8 commit 3bdd2d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hugify.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def apply_gif_save(input_fns, func, fn_out='output.gif', **kwargs):

# treat a static image as 1-frame GIF
# TODO: do better interlacing, maybe with greatest common denominator etc (-> filesize limit?)
total_frames = min( ( len(sequence) for sequence in frames if len(sequence) ), default=1 )
total_frames = min( ( len(sequence) for sequence in frames if len(sequence) > 1 ), default=1 )
frames = [ sequence * total_frames if len(sequence) == 1 else sequence for sequence in frames ]
frames = [ func(people, **kwargs) for people in zip(*frames) ]

Expand Down

0 comments on commit 3bdd2d3

Please sign in to comment.