Skip to content

Commit

Permalink
Handle one-frame images
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Feb 19, 2022
1 parent 8fc6369 commit 46c5a54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/utils/images.py
Expand Up @@ -226,7 +226,8 @@ def render_animation(
pad = all(size) if pad is None else pad
source = Image.open(template.get_image(style="animated"))
duration = source.info.get("duration", 100)
if total := getattr(source, "n_frames", 0):
total = getattr(source, "n_frames", 1)
if total > 1:
sources = ImageSequence.Iterator(source)
elif any(text.animated for text in template.text):
sources = [source] * settings.MAXIMUM_FRAMES
Expand Down

0 comments on commit 46c5a54

Please sign in to comment.