Bug 690036

Summary: clipping differ from Adobe
Product: Ghostscript Reporter: leonardo <leonardo>
Component: Graphics LibraryAssignee: Robin Watts <robin.watts>
Status: RESOLVED DUPLICATE    
Severity: normal CC: christinedelight.top85, shailesh.mistry
Priority: P2 Keywords: discuss
Version: master   
Hardware: PC   
OS: Windows NT   
Customer: Word Size: ---
Bug Depends on:    
Bug Blocks: 689264    

Description leonardo 2008-08-21 06:35:24 UTC
The PDF reference manual version 1.7 reads on page 511 : "For clipping, the 
clipping region consists of the set of pixels that would be included
by a fill operation.". Our implementation doesn't follow it. 

When a path is filled, we paint those pixels, which's centers fall inside the 
path expanded with fill adjustement. The fill adjustment depends on 
resolution. With small resolutions it is 0.25, with high resolutions it is 
0.5 .

When clipping with a single rectangle gx_clip_list_from_rectangle rounds the 
lower boundary down to integral pixels and does the upper boundary up, what is 
equivalent to fill_adjust=0.5 . When clipping with a complex path, 
gx_cpath_intersect_path_slow applies fill_adjust=0.5 .

Thus with small resolution our clipping differs from Adobe.

This problem was discovered while analyzing Bug 689264 "Regression: 
differences in Testform.v1.0.2.pdf".
Comment 1 Henry Stiles 2009-11-19 07:50:34 UTC
Reassigning path and fill problems to Robin Watts.
Comment 2 Robin Watts 2010-01-28 17:22:58 UTC
Reassigning to new email address.
Comment 3 Shailesh Mistry 2011-08-03 19:13:40 UTC
Bug still reproducible in Ghostscript 9.03
Comment 4 Ray Johnston 2013-06-03 20:16:30 UTC
This is the underlying problem with bug 693509, which is a customer bug with
a file attached, so I am marking this one a duplicate of that one.

*** This bug has been marked as a duplicate of bug 693509 ***