Bug 691670 - -sOutputICCProfile does not work
Summary: -sOutputICCProfile does not work
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Color (show other bugs)
Version: master
Hardware: PC All
: P2 normal
Assignee: Michael Vrhel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-08 16:09 UTC by Marcos H. Woehrmann
Modified: 2011-10-02 02:35 UTC (History)
0 users

See Also:
Customer: 850
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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