Bug 691670

Summary: -sOutputICCProfile does not work
Product: Ghostscript Reporter: Marcos H. Woehrmann <marcos.woehrmann>
Component: ColorAssignee: Michael Vrhel <michael.vrhel>
Status: NOTIFIED FIXED    
Severity: normal    
Priority: P2    
Version: master   
Hardware: PC   
OS: All   
Customer: 850 Word Size: ---

Description Marcos H. Woehrmann 2010-10-08 16:09:59 UTC
From the customers email:

With the fresh release of Ghostscript 9.00 the parameter -sOutputICCProfile
does not work.
A quick & dirty attempt to repair this is to add some lines to
gx_default_put_params in base\gsdparam.c, around line 636:

  /* Copy device ICC profile name in the device */
  if (&(dev->color_info.icc_profile[0]) != (char *)(icc_pro.data))
+  {
    memcpy(&(dev->color_info.icc_profile[0]), icc_pro.data, icc_pro.size);
+    dev->color_info.icc_profile[icc_pro.size]=0;  // add zero-teminator
+    if (dev->device_icc_profile != NULL)
+      dev->device_icc_profile->num_comps = 0;  // force reload of profile
+  }

We observed these quirks:
- The copied character array is not zero-terminated
- The corresponding profile for the original name is already loaded (why?)
and must therefore be re-loaded with the overridden name

How can I submit file names with special characters (such as spaces or
dashes) to the parameter -sOutputICCProfile or similar parameters? It would
help if I could surround it with quote characters or alternatively provide
it as a hexstring.
Comment 1 Michael Vrhel 2010-10-08 16:44:23 UTC
Fixed with rev 11757