Bug 688159 - Problem decoding PDF with JPXDecode data
Summary: Problem decoding PDF with JPXDecode data
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: master
Hardware: PC AIX
: P3 major
Assignee: Ralph Giles
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-22 11:53 UTC by Nathan Aldridge
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
Ghostscript output log (2.21 KB, text/plain)
2005-06-22 11:54 UTC, Nathan Aldridge
Details
PDF file that can cause the error (324.07 KB, application/pdf)
2005-06-22 11:55 UTC, Nathan Aldridge
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Aldridge 2005-06-22 11:53:54 UTC
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.
Comment 1 Nathan Aldridge 2005-06-22 11:54:30 UTC
Created attachment 1468 [details]
Ghostscript output log
Comment 2 Nathan Aldridge 2005-06-22 11:55:12 UTC
Created attachment 1469 [details]
PDF file that can cause the error
Comment 3 Nathan Aldridge 2005-06-22 11:56:34 UTC
Platform is AIX 5.1, using the latest from CVS compiled using GCC etc...
Comment 4 Alex Cherepanov 2005-06-22 12:40:39 UTC
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.
Comment 5 Ralph Giles 2005-06-29 04:14:43 UTC
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.
Comment 6 Ralph Giles 2008-12-18 18:09:28 UTC
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.