Changeset 220 for pkpgcounter/trunk/pdlanalyzer/tiff.py
- Timestamp:
- 07/02/05 15:41:30 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pdlanalyzer/tiff.py
r219 r220 29 29 from pdlanalyzer import pdlparser 30 30 31 class TIFFParser(pdlparser.PDLParser) :31 class Parser(pdlparser.PDLParser) : 32 32 """A parser for TIFF documents.""" 33 def isValid(self) : 34 """Returns 1 if data is TIFF, else 0.""" 35 littleendian = (chr(0x49)*2) + chr(0x2a) + chr(0) 36 bigendian = (chr(0x4d)*2) + chr(0) + chr(0x2a) 37 if self.firstblock[:4] in (littleendian, bigendian) : 38 if self.debug : 39 sys.stderr.write("DEBUG: Input file is in the TIFF format.\n") 40 return 1 41 else : 42 return 0 43 33 44 def getJobSize(self) : 34 45 """Counts pages in a TIFF document. … … 77 88 mustclose = 1 78 89 try : 79 parser = TIFFParser(infile, debug=1)90 parser = Parser(infile, debug=1) 80 91 totalsize += parser.getJobSize() 81 92 except pdlparser.PDLParserError, msg :