Skip to content

Commit

Permalink
Fixed round error in saving apng file
Browse files Browse the repository at this point in the history
  • Loading branch information
thak1411 committed Jul 13, 2021
1 parent 83c05aa commit 45aec95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/PIL/PngImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1117,12 +1117,12 @@ def _write_multiple_frames(im, fp, chunk, rawmode):
and prev_disposal == encoderinfo.get("disposal")
and prev_blend == encoderinfo.get("blend")
):
duration = encoderinfo.get("duration", 0)
if duration:
now_duration = encoderinfo.get("duration", 0)
if now_duration:
if "duration" in previous["encoderinfo"]:
previous["encoderinfo"]["duration"] += duration
previous["encoderinfo"]["duration"] += now_duration
else:
previous["encoderinfo"]["duration"] = duration
previous["encoderinfo"]["duration"] = now_duration
continue
else:
bbox = None
Expand Down

0 comments on commit 45aec95

Please sign in to comment.