Changeset 434 for pkpgcounter/trunk/pkpgpdls/analyzer.py
- Timestamp:
- 10/27/06 23:39:58 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/analyzer.py
r427 r434 83 83 try : 84 84 pdlhandler = self.detectPDLHandler() 85 (handle, filename) = tempfile.mkstemp(".tmp", "pkpgcounter") 86 os.close(handle) 85 87 try : 86 tiffname = self.convertToTiffMultiPage24NC(pdlhandler)87 result = inkcoverage.getInkCoverage( tiffname, cspace)88 pdlhandler.convertToTiffMultiPage24NC(filename, self.options.resolution) 89 result = inkcoverage.getInkCoverage(filename, cspace) 88 90 finally : 89 91 try : 90 os.remove( tiffname)92 os.remove(filename) 91 93 except OSError : 92 sys.stderr.write("Problem when trying to remove temporary file %s\n" % tiffname)94 sys.stderr.write("Problem when trying to remove temporary file %s\n" % filename) 93 95 except pdlparser.PDLParserError, msg : 94 96 raise pdlparser.PDLParserError, "Unknown file format for %s (%s)" % (self.filename, msg) … … 96 98 self.closeFile() 97 99 return result 98 99 def convertToTiffMultiPage24NC(self, handler) :100 """Converts the input file to TIFF format, X dpi, 24 bits per pixel, uncompressed.101 Returns a temporary filename which names a file containing the TIFF datas.102 The temporary file has to be deleted by the caller.103 """104 self.infile.seek(0)105 (handle, filename) = tempfile.mkstemp(".tmp", "pkpgcounter")106 os.close(handle)107 handler.convertToTiffMultiPage24NC(filename, self.options.resolution)108 return filename109 100 110 101 def openFile(self) :