summaryrefslogtreecommitdiff
path: root/gs/base/gdevp14.c
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2011-07-21 21:50:59 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2011-07-22 10:04:59 -0700
commit9d37cdcdbcb3b3bb23d0eab06d1683735303d5e1 (patch)
treeb51a12cc23be9e0fa17b6e3f2b3162d0d78d20cb /gs/base/gdevp14.c
parent554ce829a9eb59da437541e2efbc646d9edc2805 (diff)
Fix for bug 692364 in which we were were not handing the initial DeviceGray profiles correctly
When the graphic state is started, the color spaces are first set to DeviceGray. In certain documents this is then the color space that is used for drawing and in fact the erase page will initially occur with this color space. If I have a destination ICC profile like CIELAB, then this is a problem since we will end up mapping DeviceGray to RGB with the old procedures giving us a CIELAB value of [255 255 255] which is a very bright red. With this fix we in the DeviceGray mapping we fix the colorspace to be ICC based and pass then handle the procedure with the ICC mapping. A minor fix was also needed in the pdf14device put_image where we use a DeviceGray color space, which happens to have an ICC profile. We now correctly create the ICC profile. Note that this will cause significant diffs in the cluster push as DeviceGray colors that were mapped to pure K before for a CMYK device (due to the fact that we were not installing the proper color space) will now map to composite black. This issue will be addressed shortly by another commit where we by default map all DeviceGray colors to K only in the CMYK devices.
Diffstat (limited to 'gs/base/gdevp14.c')
-rw-r--r--gs/base/gdevp14.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/gs/base/gdevp14.c b/gs/base/gdevp14.c
index cc8e4dafe..02c2e701a 100644
--- a/gs/base/gdevp14.c
+++ b/gs/base/gdevp14.c
@@ -56,6 +56,7 @@
#include "gximage.h"
#include "gsmatrix.h"
#include "gxdevsop.h"
+#include "gsicc.h"
#if RAW_DUMP
unsigned int global_index = 0;
@@ -1546,23 +1547,9 @@ pdf14_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target)
}
}
/*
- * Set color space to either Gray, RGB, or CMYK in preparation for sending
- * an image.
+ * Set color space in preparation for sending an image.
*/
- switch (num_comp) {
- case 1: /* DeviceGray */
- pcs = gs_cspace_new_DeviceGray(pis->memory);
- break;
- case 3: /* DeviceRGB */
- pcs = gs_cspace_new_DeviceRGB(pis->memory);
- break;
- case 4: /* DeviceCMYK */
- pcs = gs_cspace_new_DeviceCMYK(pis->memory);
- break;
- default: /* Should never occur */
- return_error(gs_error_rangecheck);
- break;
- }
+ code = gs_cspace_build_ICC(&pcs, NULL, pis->memory);
if (pcs == NULL)
return_error(gs_error_VMerror);
/* Need to set this to avoid color management during the
@@ -1571,7 +1558,6 @@ pdf14_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target)
default RGB to CIELAB in the put image operation. That will happen
here as we should have set the profile for the pdf14 device to RGB
and the target will be CIELAB */
-
code = dev_proc(dev, get_profile)(dev, &dev_profile);
gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile,
&(pcs->cmm_icc_profile_data), &rendering_intent);