Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added WebP default duration of zero when saving #6140

Merged
merged 1 commit into from Mar 22, 2022

Conversation

radarhere
Copy link
Member

Resolves #6139

When saving multiple frames to a WebP image, there is currently no default duration.

duration = im.encoderinfo.get("duration", im.info.get("duration"))

But duration is added together when iterating over each frame.

timestamp = 0

if isinstance(duration, (list, tuple)):
timestamp += duration[frame_idx]
else:
timestamp += duration

That can lead to an error, because None cannot be added to 0.

This PR adds a default duration of zero.

@hugovk hugovk merged commit a6a843e into python-pillow:main Mar 22, 2022
@radarhere radarhere deleted the webp_duration branch March 22, 2022 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebP plugin save animated webp need default duration value
2 participants