diff options
author | Sam James <sam@gentoo.org> | 2022-09-21 14:18:08 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-10-02 04:31:25 +0100 |
commit | a529111f77ff46f4836fe7312e70953bc16587cf (patch) | |
tree | 9dc3924cb1a6ef3ef853b7bb45f735365e0b4e6d /devices/gdevpsd.c | |
parent | Import Ghostscript 9.56.1 (diff) | |
download | ghostscript-gpl-patches-ghostscript-10.tar.gz ghostscript-gpl-patches-ghostscript-10.tar.bz2 ghostscript-gpl-patches-ghostscript-10.zip |
Import Ghostscript 10.0ghostscript-10.0ghostscript-10
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'devices/gdevpsd.c')
-rw-r--r-- | devices/gdevpsd.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/devices/gdevpsd.c b/devices/gdevpsd.c index d538b784..2a54a471 100644 --- a/devices/gdevpsd.c +++ b/devices/gdevpsd.c @@ -942,12 +942,20 @@ psd_setup(psd_write_ctx *xc, gx_devn_prn_device *dev, gp_file *file, int w, int xc->num_channels = i; if (dev->color_info.polarity == GX_CINFO_POLARITY_SUBTRACTIVE && strcmp(dev->dname, "psdcmykog") != 0) { + + /* Note: num_separation_order_names is only set if + SeparationColorNames was setup. If this was not set, + we need may need to make use of the ICCOutputColors + and page spot colors for our setup. */ if (dev->devn_params.num_separation_order_names == 0) { /* Page spot colors has been truncated to ensure max colorants of the target device is not exceeded. This is set if PDF file was encountered and should be used. - Also make sure PS file does not exceed limit of device. */ - if (dev->devn_params.page_spot_colors > 0) + Also make sure PS file does not exceed limit of device. + However, if ICCOutputColors was specified, that should + take precedence. */ + if (dev->devn_params.page_spot_colors > 0 && + dev->icc_struct->spotnames == NULL) xc->n_extra_channels = dev->devn_params.page_spot_colors; else { if (dev->devn_params.separations.num_separations <= (dev->color_info.max_components - NUM_CMYK_COMPONENTS)) @@ -1008,13 +1016,13 @@ psd_setup(psd_write_ctx *xc, gx_devn_prn_device *dev, gp_file *file, int w, int bool has_tags = (pdev_psd->color_model == psd_DEVICE_CMYKT); xc->num_channels += xc->n_extra_channels; - for (i=xc->base_num_channels; i < xc->num_channels; i++) { + for (i=xc->base_num_channels + has_tags; i < xc->num_channels; i++) { int j; const char *curr = "\377"; int curr_size = 1; bool compare; - for (j=xc->base_num_channels; j < (xc->num_channels - has_tags); j++) { + for (j=xc->base_num_channels + has_tags; j < xc->num_channels; j++) { devn_separation_name *separation_name; separation_name = &(dev->devn_params.separations.names[j - xc->base_num_channels]); |