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

BUG: n_frames is incorrect #6320

Closed
WuZifan opened this issue May 23, 2022 · 1 comment · Fixed by #6219
Closed

BUG: n_frames is incorrect #6320

WuZifan opened this issue May 23, 2022 · 1 comment · Fixed by #6219
Labels

Comments

@WuZifan
Copy link

WuZifan commented May 23, 2022

What did you do?

i try to load every frame of a gif by the following code

# PILLOW==9.1.0

img = Image.open('./test.gif')
for I in range(img.n_frames):
    tmp.seek(i)

below is the test img and I find that img.n_frames gives me 2 but the actual frame number is 1,so the seek function raise an EOF error.

13077030995698418847

What did you expect to happen?

load all the frame without any error

What actually happened?

The following error is raised.
raise EOFError("no more images in GIF file") from e

What are your OS, Python and Pillow versions?

  • OS: macos m1
  • Python: 3.7.0
  • Pillow: 9.1.0
from PIL import Image
img = Image.open('./test.gif')
for I in range(img.n_frames):
    tmp.seek(i)
@radarhere
Copy link
Member

Testing, I find that #6219 will resolve this.

@hugovk hugovk changed the title BUG: n_frames is incorrect! BUG: n_frames is incorrect May 27, 2022
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 a pull request may close this issue.

2 participants