Changeset 489 for pkpgcounter/trunk/pkpgpdls/tiff.py
- Timestamp:
- 11/17/07 16:21:11 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/tiff.py
r463 r489 66 66 raise pdlparser.PDLParserError, "Unknown file endianness." 67 67 pos = 4 68 try : 69 nextifdoffset = unpack(integerbyteorder, minfile[pos : pos + 4])[0] 70 while nextifdoffset : 71 direntrycount = unpack(shortbyteorder, minfile[nextifdoffset : nextifdoffset + 2])[0] 72 pos = nextifdoffset + 2 + (direntrycount * 12) 68 try : 69 try : 73 70 nextifdoffset = unpack(integerbyteorder, minfile[pos : pos + 4])[0] 74 pagecount += 1 75 except IndexError : 76 pass 77 minfile.close() 71 while nextifdoffset : 72 direntrycount = unpack(shortbyteorder, minfile[nextifdoffset : nextifdoffset + 2])[0] 73 pos = nextifdoffset + 2 + (direntrycount * 12) 74 nextifdoffset = unpack(integerbyteorder, minfile[pos : pos + 4])[0] 75 pagecount += 1 76 except IndexError : 77 pass 78 finally : 79 minfile.close() 78 80 return pagecount 79 81