The attached PDF-files, generated by Adobe Acrobat 6.0 Image Conversion Plug-in, cannot be interpreted by GhostScript. Following message is produced: AFPL Ghostscript 8.54 (2006-05-17) Copyright (C) 2005 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Processing pages 1 through 1. Page 1 Error: /undefined in --get-- Operand stack: --dict:7/7(L)-- --dict:9/12(L)-- --dict:9/12(L)-- ColorSpace
Created attachment 2705 [details] Example for PDF, which cannot be interpreted
Created attachment 2706 [details] Example for PDF, which cannot be interpreted
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. This problem has been reported earlier as a bug 688159.
Created attachment 2903 [details] jpxcs-workaround.diff This is a work around for the problem, not a proper fix. This patch checks for the missing keys in the image dict and fills them in for the common case. That is, it assumes an 8 bpc RGB image, which is the case with both of these files. Note that on MS Windows there seem to be some rendering problems with both files. However, with this patch they render correctly under Linux and MacOS X. A proper fix requires some architectural changes, and will take some time.
Ray suggests we commit the workaround and emit "*** Warning:RGB assumed for JPXDecode colorspace ***" to stderr.
The workaround was committed in r9297. With this change the files are interpreted properly. I've opened a bug 690207 to track the resolution of the complete colorspace-in-stream issue for non-RGB images. This one is considered closed.