Bug 688641

Summary: pdfwrite is_in_page is broken, leads to spurious transparency
Product: Ghostscript Reporter: Ian Jackson <iwj>
Component: PDF WriterAssignee: leonardo <leonardo>
Status: NOTIFIED FIXED    
Severity: normal    
Priority: P4    
Version: 8.15   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: Handover.ps
bad_patch.txt

Description Ian Jackson 2006-04-10 04:18:45 UTC
At https://launchpad.net/distros/ubuntu/+source/gs-gpl/+bug/33255 an ubuntu user
reports that a particular eps, when converted to pdf with gs pdfwrite,
erroneously leaves a particular rectangle transparent rather than filling it
with white.

The cause is the definition of is_in_page and the code which uses it. 
is_in_page is tested by gdev_pdf_fill_rectangle and prepare_fill_with_clip, with
the intent of suppressing the initial fill of the entire page with white.

However, this approach is incorrect, because it suppresses _any number_ of
initial white fills.  In particular, if the first drawing operation on a page is
a white fill, it is suppressed.  This is the case in the test file attached to
the Ubuntu bug report, above.

I'm not sure how best to fix this because I'm not sufficiently familiar with the
innards of gs, so I don't know what the right approach is and I'm afraid I
haven't supplied a patch.

Thanks.
Comment 1 leonardo 2006-08-11 08:27:06 UTC
Created attachment 2413 [details]
Handover.ps

A local copy of the test file.
Comment 2 leonardo 2006-08-11 08:38:46 UTC
Created attachment 2414 [details]
bad_patch.txt

A patch which implements exactly what suggested. It appears not good because
enlarges the re-distilled 0.pdf .
Comment 3 leonardo 2006-08-11 10:52:24 UTC
Patch to HEAD :
http://ghostscript.com/pipermail/gs-cvs/2006-August/006746.html