[gs-commits] rev 11872 - in trunk/gs: base psi

ken at ghostscript.com ken at ghostscript.com
Fri Oct 29 09:05:44 UTC 2010


Author: ken
Date: 2010-10-29 09:05:42 +0000 (Fri, 29 Oct 2010)
New Revision: 11872

Modified:
   trunk/gs/base/gscdevn.c
   trunk/gs/psi/zcolor.c
Log:
Fix : DeviceN not permitting multiple identical inks

Bug #691740

The DeviceN checking code did not permit multiple inks to have the same name. The
comment in the code says this is not permitted, but I am unable to find any
documentation in any of the specifications in support of this, and other interpreters
(including CPSI) do not make this restriction.

Restriction removed, and also the 'continuation' procedures used for much of the colour
space parsing/validation have been given names so that future error messages use these
instead of printing the function address.

No differences expected.


Modified: trunk/gs/base/gscdevn.c
===================================================================
--- trunk/gs/base/gscdevn.c	2010-10-28 20:41:14 UTC (rev 11871)
+++ trunk/gs/base/gscdevn.c	2010-10-29 09:05:42 UTC (rev 11872)
@@ -471,15 +471,13 @@
 {
     const gs_separation_name *names = pcs->params.device_n.names;
     int num_comp = pcs->params.device_n.num_components;
-    int i, j;
+    int i;
     int colorant_number;
     byte * pname;
     uint name_size;
     gs_devicen_color_map * pcolor_component_map
 	= &pgs->color_component_map;
     gx_device * dev = pgs->device;
-    const char none_str[] = "None";
-    const uint none_size = strlen(none_str);
     bool non_match = false;
 
     pcolor_component_map->num_components = num_comp;
@@ -504,24 +502,6 @@
 	 */
 	pcs->params.device_n.get_colorname_string(dev->memory, names[i], &pname, &name_size);
 	/*
-         * Postscript does not accept /None as a color component but it is
-         * allowed in PDF so we accept it.  It is also accepted as a
-	 * separation name.
-         */
-	if (name_size == none_size &&
-	        (strncmp(none_str, (const char *)pname, name_size) == 0)) {
-	    pcolor_component_map->color_map[i] = -1;
-	}
-	else {
- 	    /*
-	     * Check for duplicated names.  Except for /None, no components
-	     * are allowed to have duplicated names.
-	     */
-	    for (j = 0; j < i; j++) {
-	        if (names[i] == names[j])
-		    return_error(gs_error_rangecheck);
-            }
-	    /*
 	     * Compare the colorant name to the device's.  If the device's
 	     * compare routine returns GX_DEVICE_COLOR_MAX_COMPONENTS then the
 	     * colorant is in the SeparationNames list but not in the
@@ -537,7 +517,6 @@
 	    else
 		non_match = true;
         }	
-    }
     pcolor_component_map->use_alt_cspace = non_match;
     return 0;
 }

Modified: trunk/gs/psi/zcolor.c
===================================================================
--- trunk/gs/psi/zcolor.c	2010-10-28 20:41:14 UTC (rev 11871)
+++ trunk/gs/psi/zcolor.c	2010-10-29 09:05:42 UTC (rev 11872)
@@ -6584,5 +6584,13 @@
     /* Operators to deal with setting stroking/non-stroking colors
      * individually */
     { "1.swapcolors", zswapcolors },
+
+    /* internal operators, entries here only used for error reporting */
+    { "0%setcolorspace_cont", setcolorspace_cont },
+    { "0%setcolor_cont", setcolor_cont },
+    { "0%devicencolorants_cont", devicencolorants_cont },
+    { "0%indexed_cont", indexed_cont },
+    { "0%setdevicecolor_cont", setdevicecolor_cont },
+    { "0%currentbasecolor_cont", currentbasecolor_cont },
     op_def_end(0)
 };



More information about the gs-commits mailing list