[Image-SIG] PIL: stepping through multi-page tiff files

Randy Trigg trigg@parc.xerox.com
Thu, 20 May 1999 15:20:02 PDT

Has anyone had any trouble with the PIL support for multi-page tiffs?  I
have a 9-page tiff file (packbits compression) which I open in PIL, as

  im = Image.open(foo.tif)

Then I call im.seek(1), im.seek(2), ..., im.seek(9).  I only get four
steps of this before it dies with "Missing TIFF directories."  Looking
at the frames it generates, I can see that successive seeks skip frames,
that is, seek(1) gives me page 3, seek(2) gives page 5, seek(3) gives
page 7, and seek(4) gives page 9 (thus the error after the fourth seek).

I've tried some variations like seek(0), seek(1), seek(0), seek(2),
seek(0), seek(3), etc.  That gives me more of the pages, 7 or 8, but
with one of the pages repeated.  But no variation gives me all of the

I tried to do this with an uncompressed version of the tiff file, but
still no luck.  By the way, the tiff file is fine - all 9 pages are
viewable with the "Imaging for NT" application.

Any ideas?  Thanks much,

       - Randy