Bug 689247

Summary: pdfwrite creates redundant shadings.
Product: Ghostscript Reporter: leonardo <leonardo>
Component: PDF WriterAssignee: Ken Sharp <ken.sharp>
Status: RESOLVED FIXED    
Severity: enhancement CC: christinedelight.top85, shailesh.mistry
Priority: P4    
Version: 0.00   
Hardware: PC   
OS: Windows XP   
Customer: Word Size: ---

Description leonardo 2007-05-24 14:41:23 UTC
Re-distilling Bug689189.pdf got 8000+ shadings from source 70 ones.
Comment 1 leonardo 2007-08-29 20:54:46 UTC
Passing to Ken since he handles pdfwrite from now.
Comment 2 Ken Sharp 2007-12-13 00:42:19 UTC
*** Bug 689572 has been marked as a duplicate of this bug. ***
Comment 3 Ken Sharp 2009-02-03 03:27:27 UTC
Seems that at present we have no way to know if use of a shading pattern is
initial or reuse. Each pattern seems to get its own unique ID, which means we
can't simply keep a cache and test IDs.

Looks like we need to cache patterns and their matrix, also the shading
dictionary associated with the pattern so that we can test new patterns to see
if we already have a stored copy.

Lots of work, prone to error....

However, there is nothing actually wrong with the current output except size and
performance, so altering to 'enhancement'.
Comment 4 Shailesh Mistry 2011-07-23 14:36:51 UTC
Enhancement still missing in Ghostscript 9.03
Comment 5 Ken Sharp 2013-11-26 08:23:51 UTC
Commit fe99ca5fd2e3b191a76c7f7d791b72f3603e9fea fixes this. The output file now only contains 106 shadings, and is 41% smaller than before.

Note that this fix also depends on the following commits:

90ec17f20be53db00fcbc2ada6931e7cc7b22b9e

cdd142387a04a6d7ea519838e15204c4d7c681d8