I am getting the following dump from ghostscript whenever I attempt to process PDF files with JPEG2000 data in it. I am enclosing a simple image that was converted to JPEG2000 and written out to PDF by Acrobat. My command line options are: gs -q -dNOPAUSE -r200 -sDEVICE=tiffg4 -dBATCH -dUseCropBox -sOutputFile=v1.tif vancouver_1.pdf I have attached Ghostscript log output and also the PDF file that causes it.
Created attachment 1468 [details] Ghostscript output log
Created attachment 1469 [details] PDF file that can cause the error
Platform is AIX 5.1, using the latest from CVS compiled using GCC etc...
The sample PDF file doesn't have a ColorSpace key in the image dictionary. According to PDF 1.6 spec, if ColorSpace is absent, the color space specifications in the JPEG2000 data are used. The Decode array is also ignored unless ImageMask is true. Ghostscript doesn't yet support this feature and requires the ColorSpace key in all cases.
Hi Nathan, continuing to live on the edge I see. And thanks Alex for tracking down the /undefined. It is unfortunate that Acrobat is making use of that particular spec wart. I guess the best approach is to add some sort of pre-process operator that reads the data out of the stream and spruces up the image dict, a little like we do with the JBIG2Decode JBIG2Globals filter param. It's tempting to just read the file directly for this, but that will fail if there are any other filters on the stream before the JPXDecode.
A work around for this was added in r9297. I've opened a new bug to track the resolution of the complete colorspace-in-stream issue for non-RGB images.