Bug 689058 - Interpretation of PDF fails
Summary: Interpretation of PDF fails
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 8.54
Hardware: PC Windows XP
: P2 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks: 689509
  Show dependency tree
 
Reported: 2007-01-25 02:34 UTC by artifex
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer: 870
Word Size: ---


Attachments
jpxcs-workaround.diff (802 bytes, patch)
2007-04-19 16:15 UTC, Ralph Giles
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description artifex 2007-01-25 02:34:55 UTC
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
Comment 1 artifex 2007-01-25 02:37:01 UTC
Created attachment 2705 [details]
Example for PDF, which cannot be interpreted
Comment 2 artifex 2007-01-25 02:38:50 UTC
Created attachment 2706 [details]
Example for PDF, which cannot be interpreted
Comment 3 Alex Cherepanov 2007-01-25 07:05:06 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.

This problem has been reported earlier as a bug 688159.
Comment 4 Ralph Giles 2007-04-19 16:15:28 UTC
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.
Comment 5 Ralph Giles 2008-12-16 09:36:14 UTC
Ray suggests we commit the workaround and emit "*** Warning:RGB assumed for
JPXDecode colorspace ***" to stderr.
Comment 6 Ralph Giles 2008-12-18 18:11:35 UTC
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.