Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@thak1411
Copy link
Contributor

@thak1411 thak1411 commented Jul 13, 2021

Resolves #5608

This issue is caused by the 'duration' variable being overwritten.

duration = encoderinfo.get("duration", 0)

After being overwritten, the duration variable is not updated.

if isinstance(duration, (list, tuple)):
encoderinfo["duration"] = duration[frame_count]

@thak1411 thak1411 changed the title Fixed round error in saving apng file Fixed round error in saving .apng file Jul 13, 2021
@dogemad
Copy link

dogemad commented Jul 13, 2021

Yes. There is a problem in that 'duration', which should be passed as an integer to the following context, is passed as a list by redefining the same variable names in lines 1062 and 1120 (if the condition: 1115 ~ 1119 is satisfied, This condition is satisfied when the same frame as the previous frame in the animated image is detected in succession.). So in this case using the round method on the list will throw an error.

@radarhere
Copy link
Member

I've created thak1411#1 with some suggestions.

@thak1411
Copy link
Contributor Author

Thank you for your suggestion. The merge is complete.

@radarhere radarhere changed the title Fixed round error in saving .apng file Fixed error saving APNG with duplicate frames and different duration times Jul 13, 2021
@radarhere radarhere merged commit 1fd0411 into python-pillow:master Jul 13, 2021
@thak1411
Copy link
Contributor Author

thanks @dogemad @radarhere !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

type list doesn't define __round__ method

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.