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

Error when saving apng with save_all #7459

Closed
Yay295 opened this issue Oct 12, 2023 · 1 comment · Fixed by #7437
Closed

Error when saving apng with save_all #7459

Yay295 opened this issue Oct 12, 2023 · 1 comment · Fixed by #7437

Comments

@Yay295
Copy link
Contributor

Yay295 commented Oct 12, 2023

from PIL import Image
img = Image.open('num_plays.png')
img.save('test.apng',save_all=True)

num_plays.png is in https://github.com/python-pillow/Pillow/tree/main/Tests/images/apng.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../.venv/Lib/site-packages/PIL/Image.py", line 2413, in save
    save_handler(self, fp, filename)
  File ".../.venv/Lib/site-packages/PIL/PngImagePlugin.py", line 1218, in _save_all
    _save(im, fp, filename, save_all=True)
  File ".../.venv/Lib/site-packages/PIL/PngImagePlugin.py", line 1241, in _save
    mode = modes.pop()
           ^^^^^^^^^^^
KeyError: 'pop from an empty set'

This error doesn't occur without save_all=True, but then it doesn't save all frames. Saving as a GIF works.

@Yay295 Yay295 changed the title Error when saving apng wth save_all Error when saving apng with save_all Oct 12, 2023
@radarhere
Copy link
Member

This is resolved by #7437

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 a pull request may close this issue.

2 participants