Bug 696864 - Arrows missing from output
Summary: Arrows missing from output
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: master
Hardware: PC Linux
: P4 normal
Assignee: Ray Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-22 17:51 UTC by Marcos H. Woehrmann
Modified: 2016-10-11 08:23 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
output.png (18.50 KB, image/png)
2016-06-22 17:55 UTC, Marcos H. Woehrmann
Details
fails_ghostscript_9.19.pdf (16.29 KB, application/pdf)
2016-06-22 17:55 UTC, Marcos H. Woehrmann
Details
simplified PDF file (51.47 KB, application/pdf)
2016-06-23 02:11 UTC, Ken Sharp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2016-06-22 17:51:25 UTC
This is a continuation of Bug 696682.

The user reports and I've verified that Ghostscript renders this file without the expected arrows.  MuPDF and Acrobat render the file correctly.

The command line I'm using for testing:

  bin/gs -sDEVICE=ppmraw -o test.ppm ./fails_ghostscript_9.19.pdf
Comment 1 Marcos H. Woehrmann 2016-06-22 17:54:11 UTC
This is a partial regression, commits before 6a82ae29ea4826048fc923388f4f59823e3a55c6 render the image with the arrows partially visible (see attached output.png).
Comment 2 Marcos H. Woehrmann 2016-06-22 17:55:09 UTC
Created attachment 12630 [details]
output.png
Comment 3 Marcos H. Woehrmann 2016-06-22 17:55:40 UTC
Created attachment 12631 [details]
fails_ghostscript_9.19.pdf
Comment 4 Ken Sharp 2016-06-23 02:11:29 UTC
Created attachment 12632 [details]
simplified PDF file

This appears to be a transparency problem (maybe).

The original file is quite complex (almost certainly more complex than necessary) making use of shadings and multiple levels of transparency. The attached file has been considerably simplified.

The first arrow is now painted quite simply, the second has had the shading used to draw a gradient fill removed, but the ExtGState remains, this ExtGState uses an SMask entry to apply Luminosity blending with an additional Group. The Group is itself a form, containing its own transparency group and using a Pattern to generate a gradient which it applies to a large rectangular fill. In practice it 'appears' that this generates a flat fill, judging by the fact that the data used to generate the Function is all identical. However, removing any part of the transparency causes the problem to go away.

Probably one for Michael to investigate.
Comment 5 Michael Vrhel 2016-10-05 16:50:23 UTC
Spent a bit of time looking at this.  So the pattern fill ends up filling the soft mask with a gray value of 2.  This results in a very very light arrow.  Something is amiss there as the result of the drawing is correct (i.e. the actual drawing of the arrow before the mask is pure black).  Digging a bit further.
Comment 6 Michael Vrhel 2016-10-06 13:09:48 UTC
I have a fix I am now testing for this.
Comment 7 Michael Vrhel 2016-10-07 20:28:42 UTC
After digging a bit more it appears to me that when we are in a softmask group we should ignore all the embedded ICC profiles.   Essentially there is a mismatch in gamma values that is driving this.  I will plan to chat with Ken about working in the interpreter to see about disabling embedded ICC profiles for this case as it will be easier to do there.
Comment 8 Michael Vrhel 2016-10-10 13:39:47 UTC
So using -dOverrideICC fixes the issue.  The approach that we should use
for this is to enable -dOverrideICC when we execute the softmask group.

I talked with Ray and he is going to do this in the interpreter.  Which
is to push the existing value of OverrideICC, set it true, execute the mask
group, and restore the OverrideICC value.
Comment 9 Ray Johnston 2016-10-11 08:23:35 UTC
Fixed with commit a34f71c530409a559c4cb35cb1a23296541d53c3