[gs-cvs] rev 8545 - trunk/gs/lib

alexcher at ghostscript.com alexcher at ghostscript.com
Sun Feb 24 20:20:47 PST 2008


Author: alexcher
Date: 2008-02-24 20:20:47 -0800 (Sun, 24 Feb 2008)
New Revision: 8545

Modified:
   trunk/gs/lib/pdf_draw.ps
Log:
When the values of the color key mask exceed the valid range clip them to the
nearest valid values and continue. Don't discard the mask as we did before.
Bug 689717, customer 580.

DIFFERENCES:
None


Modified: trunk/gs/lib/pdf_draw.ps
===================================================================
--- trunk/gs/lib/pdf_draw.ps	2008-02-24 09:21:54 UTC (rev 8544)
+++ trunk/gs/lib/pdf_draw.ps	2008-02-25 04:20:47 UTC (rev 8545)
@@ -1038,16 +1038,15 @@
     } if
 	% Check elements of array are within 0::(2**BitsPerComponent)-1
 	% This is a PostScript error, but AR ignores Mask in that case
-    2 BitsPerComponent exp cvi 1 sub //false 2 index {
+    1 BitsPerComponent bitshift 1 sub //false 2 index {
       % stack: max_value result_bool value
       dup 0 lt exch 3 index gt or or
     } forall exch pop {
       (\n   **** Warning: Some elements of Mask array are out of range.\n)
       pdfformaterror
-      pop /ImageType 1 def		% revert to non-masked image
-    } {
-      /MaskColor exch def
-    } ifelse
+      [ exch { 0 .max 1 BitsPerComponent bitshift 1 sub .min } forall ]
+    } if
+    /MaskColor exch def
   } {
 		% Mask is a stream, another Image XObject.
 		% Stack: datasource imagemask(false) maskstreamdict



More information about the gs-cvs mailing list