Summary: | JPX Decode provides RGB with Luratech when Indexed is expected | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Ray Johnston <ray.johnston> |
Component: | JPX/JBIG2 encode/decode | Assignee: | Alex Cherepanov <alex> |
Status: | NOTIFIED FIXED | ||
Severity: | normal | ||
Priority: | P1 | ||
Version: | master | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Customer: | 532 | Word Size: | --- |
Attachments: |
Page-8-flag-AC50A122.pdf
patch patch |
Description
Ray Johnston
2010-12-03 20:55:33 UTC
The following HACK gives the correct image, and shows that we _are_ getting RGB from the luratech decoder: *** Resource/Init/pdf_draw.ps Mon Nov 29 08:56:38 2010 --- pdf_draw.ps Fri Dec 03 13:34:26 2010 *************** *** 1411,1416 **** --- 1411,1420 ---- //last-ditch-bpc-csp exec dup /ColorSpace oknown { + ColorSpace 0 get /Indexed eq { + % For luratech decoder, we get the decoded data, not the index ??? + /ColorSpace ColorSpace 1 get def + } if % Propagate known color space to the filter /ColorSpace currentdict /ColorSpace get //add-to-last-param exec } if This is _NOT_ a solution, just a hint in case it helps. Currently both Jasper and Luratech expand indexed color spaces. I see that this can conflict with the color space in PDF file. Created attachment 7005 [details]
patch
Don't expand indexed color space in Luratech JPX decoder when PDF
color space is /Indexed. Jasper already does this.
Testing the patch with the customer's code... BTW, the sjpx_luratech.h patch needs a minor style fix (missing */ at end of line) + bool image_is_indexed; /* image is indexed, needs decoding + /* if colorspace != gs_jpx_cs_indexed */ Created attachment 7007 [details] patch Bring Luratech decoder up to the level of Jasper decoder. 1. Don't expand indexed colors when the PDF expects an indexed color space. Fix rendering of the sample file attached. 2. Recognize indexed CMYK color space and accept the palettes that are shorter than 256 colors. Fix comparefiles/Bug689362.pdf 3. Fix memory corruption that happened with 4-bit-per-pixel grayscale image and pack the nibbles by PS rules. Fix comparefiles/690174.diff Luratech now renders every file in our test suite correctly. We don't have tests for low values of bits per plane. The patch has been committed as a rev. 11936. |