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

Fix PNG seek and tell #4512

Merged
merged 3 commits into from Apr 2, 2020
Merged

Fix PNG seek and tell #4512

merged 3 commits into from Apr 2, 2020

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Apr 1, 2020

Fixes #4509.

Changes proposed in this pull request:

  • Initialise __frame to 0 to fix seek after open

src/PIL/PngImagePlugin.py Outdated Show resolved Hide resolved
Copy link
Contributor

@pmrowla pmrowla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than the one minor comment, this should resolve the issue. It definitely should have occurred to me to test seek()/tell() on a regular PNG image in my PR, sorry about that!

@hugovk
Copy link
Member Author

hugovk commented Apr 2, 2020

Thanks, updated!

Also added a test for tell.

(Travis CI has a disk space error on the s390x job and no restart button, but it's all green on my fork.)

@hugovk hugovk added the Bug Any unexpected behavior, until confirmed feature. label Apr 2, 2020
@hugovk hugovk merged commit e9afb39 into python-pillow:master Apr 2, 2020
@hugovk hugovk deleted the fix-png-seek branch April 2, 2020 07:43
@hugovk hugovk mentioned this pull request Apr 2, 2020
23 tasks
@almarklein
Copy link

Thanks for the quick fix 👍

@python-pillow python-pillow deleted a comment from codecov bot Apr 2, 2020
@hugovk hugovk changed the title Fix PNG seek Fix PNG seek and tell Apr 2, 2020
@ericpre ericpre mentioned this pull request Apr 2, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Any unexpected behavior, until confirmed feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: 'PngImageFile' object has no attribute '_PngImageFile__frame'
3 participants