The customer reports and I've verified that the attached file renders incorrectly with gs8.57. In particular: 1. The little image at the left top edge is degradated to just a line. 2. The foreground layer image is black: When opening the PDF in Acrobat you will find layer switches (optional content). If you turn off the switch "Text Color" in Acrobat you will see that part of the page becomes black. Ghostscript renders the layers as if the "Text Color" switch is turned off. But it is turned on by default. See the attached screenshot.png for a comparison of Acrobat (top) to Ghostscript 8.57 (bottom). The command line I used for testing: bin/gs -sDEVICE=ppmraw -sOutputFile=test.ppm -r200 ./p1_RGB_palette.pdf gshead and gs8.56 fail the same way. Earlier versions of Ghostscript core dump with the file.
Created attachment 3039 [details] screenshot.png
Created attachment 3040 [details] p1_RGB_palette.pdf
Optional Content is not currently supported. We will need to evaluate the difficulty of this enhancement and if/when we decide to develop it, we need to first develop a specification for controlling the visibility of the Optional Content (Layers).
The missing image appears to be a separate bug. No warnings are issued about the image (as would happen with an error). If it is determined that the missing image is not related to the Optional Content (I suspect that it is not), please open a separate bug about the missing image.
The missing image problem is related to soft masking. It is tracked now as a bug 689290.
From the Layer Properties panel in Acrobat Reader it appears that layers have a "Default state" (which is on for the non-background layer in the attached file).
Since the Optional Content is turned on by the PDF, we should process it. Later we may want to add controls for which OC layers get displayed. The development of the 'control' of layers can be opened as a separate issue.
*** Bug 689924 has been marked as a duplicate of this bug. ***
A suggestion for implementing the enhancement is to add arrays for EnableOC and DisableOC which would be a list of names (strings) to force "on" or "off" when processing. For example: -c /EnableOC [ (Background) ] def /DisableOC [ (Text Color) ] By default, we should use the 'default visiblilty'. This enhancement is needed to render selectively, but when the output is the pdfwrite device, we probably should pass the layers through, with the EnableOC and DisableOC list use to set default visibility. Henry and Alex agreed that this to be passed to Ken, since the PDF interp changes must come first, but passing the lists and the OCGName (layer name) to the pdfwrite device is in Ken's area.
*** Bug 689716 has been marked as a duplicate of this bug. ***
Created attachment 5673 [details] Partial patch This patch only skips XObjects. Contents streams and annotations are not yet implemented. This is enough to fix OC-related issues with the sample file.
Created attachment 5674 [details] partial patch Please ignore my previous patch. It's unrelated to this problem.
*** This bug has been marked as a duplicate of 690633 ***
Changing customer bugs that have been resolved more than a year ago to closed.