-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
No n_frames, or bad value for n_frames #1631
Copy link
Copy link
Closed
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.
Milestone
Description
When I feed the test file flower2.jpg into this code (from #1630)
im = Image.open( fn )
imgcnt = im.n_frames
colors = im.getcolors( im.width * im.height )
if args.hist:
for cnt, col in colors:
allcolors[ col ] += cnt
for iz in range( 1, imgcnt ):
im = Image.open( fn ) # does getcolors implicitly close????
# without the open, get "seek of closed
# file" error on line below.
im.seek( iz )
colors = im.getcolors( im.width * im.height )
for cnt, col in colors:
allcolors[ col ] += cntI get "AttributeError: n_frames"
But other .jpg files do not get that error... this one: http://nevcal.com/temporary/20151110-105826gl.jpg has no problem with the attribute error on that line, but it gets a value of 2, apparently handles the seek OK, but dies in the second call to getcolors, with "OSError: image file is truncated (0 bytes not processed)".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.