diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2015-02-23 10:15:02 -0800 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2015-02-23 10:15:02 -0800 |
commit | 46b59d18a8f4d204e83327e135c17657caefde3a (patch) | |
tree | 746291fc31fff433452f72382a0390c697948732 | |
parent | 375752983d9373b28bf1fada04fc9325673bc51c (diff) | |
download | ghostpdl-46b59d18a8f4d204e83327e135c17657caefde3a.tar.gz |
Fix issues with sICCOutputColors option
If an NCLR ICC profile is specified for output then it is also
possible to specify the colorant names associated with the profile.
This information is described by the sICCOutputColors parameter.
There was an issue where the default colorant names AND the
colorant names specified by sICCOutputColors were getting
added to the device. With this fix only the colorants specified
by sICCOutputColors are added to the device.
-rw-r--r-- | gs/base/gsdparam.c | 42 | ||||
-rw-r--r-- | gs/base/gsicc_manage.c | 5 | ||||
-rw-r--r-- | gs/devices/gdevpsd.c | 7 |
3 files changed, 26 insertions, 28 deletions
diff --git a/gs/base/gsdparam.c b/gs/base/gsdparam.c index 747edacbc..8dd0c7dee 100644 --- a/gs/base/gsdparam.c +++ b/gs/base/gsdparam.c @@ -1423,27 +1423,30 @@ e: param_signal_error(plist, param_name, ecode);\ (*dev_proc(dev, get_page_device))(dev) != 0 ) { switch (code = param_read_int(plist, (param_name = "NumCopies"), &nci)) { - case 0: - if (nci < 0) - ecode = gs_error_rangecheck; - else { - ncset = 1; - break; - } - goto nce; - default: - if ((code = param_read_null(plist, param_name)) == 0) { - ncset = 0; - break; - } - ecode = code; /* can't be 1 */ + case 0: + if (nci < 0) + ecode = gs_error_rangecheck; + else { + ncset = 1; + break; + } + goto nce; + default: + if ((code = param_read_null(plist, param_name)) == 0) { + ncset = 0; + break; + } + ecode = code; /* can't be 1 */ nce: - param_signal_error(plist, param_name, ecode); - case 1: - break; + param_signal_error(plist, param_name, ecode); + case 1: + break; + } } + /* Set the ICC output colors first */ + if ((code = param_read_string(plist, "ICCOutputColors", &icc_pro)) != 1) { + gx_default_put_icc_colorants(&icc_pro, dev); } - /* Set the directory first */ if ((code = param_read_string(plist, "OutputICCProfile", &icc_pro)) != 1) { gx_default_put_icc(&icc_pro, dev, gsDEFAULTPROFILE); } @@ -1464,9 +1467,6 @@ nce: if ((code = param_read_string(plist, "DeviceLinkProfile", &icc_pro)) != 1) { gx_default_put_icc(&icc_pro, dev, gsLINKPROFILE); } - if ((code = param_read_string(plist, "ICCOutputColors", &icc_pro)) != 1) { - gx_default_put_icc_colorants(&icc_pro, dev); - } if ((code = param_read_int(plist, (param_name = "RenderIntent"), &(rend_intent[0]))) < 0) { ecode = code; diff --git a/gs/base/gsicc_manage.c b/gs/base/gsicc_manage.c index 96a1961ad..c7840093e 100644 --- a/gs/base/gsicc_manage.c +++ b/gs/base/gsicc_manage.c @@ -1366,6 +1366,10 @@ gsicc_set_device_profile_colorants(gx_device *dev, char *name_str) int num_comps = profile_struct->device_profile[0]->num_comps; char temp_str[DEFAULT_ICC_COLORANT_LENGTH+2]; + /* If names are already set then we do not want to set default ones */ + if (profile_struct->spotnames != NULL) + return 0; + free_str = true; /* Assume first 4 are CMYK */ total_len = ((DEFAULT_ICC_COLORANT_LENGTH + 1) * (num_comps-4)) + @@ -1387,6 +1391,7 @@ gsicc_set_device_profile_colorants(gx_device *dev, char *name_str) if (profile_struct->spotnames != NULL && profile_struct->spotnames->name_str != NULL && strlen(profile_struct->spotnames->name_str) == str_len) { + /* Here we check if the names are the same */ if (strncmp(name_str, profile_struct->spotnames->name_str, str_len) == 0) { if (free_str) gs_free_object(dev->memory, name_str, diff --git a/gs/devices/gdevpsd.c b/gs/devices/gdevpsd.c index c56484f1f..df6d7a3e5 100644 --- a/gs/devices/gdevpsd.c +++ b/gs/devices/gdevpsd.c @@ -341,13 +341,6 @@ psd_prn_open(gx_device * pdev) limit_icc = false; #endif code = dev_proc(pdev, get_profile)((gx_device *)pdev, &profile_struct); - /* Check for case where someone did NOT specify sICCOutputColors but we - have an NCLR ICC profile for the output. In that case, we use a set of - "default" names */ - if (profile_struct->device_profile[0]->num_comps > 4 && - profile_struct->spotnames == NULL) { - - } if (profile_struct->spotnames == NULL) { force_pdf = false; force_ps = false; |