summaryrefslogtreecommitdiff
path: root/gs/src/gdevpdfi.c
diff options
context:
space:
mode:
authorL Peter Deutsch <lpd@ghostscript.com>2001-07-24 04:47:37 +0000
committerL Peter Deutsch <lpd@ghostscript.com>2001-07-24 04:47:37 +0000
commitfc2214cdf506f5f48c2cb61b92cc80cf6504b73e (patch)
tree85b9dd846ee53aa624147ff436f418a62de77323 /gs/src/gdevpdfi.c
parentc7474e2c00a50ecdadd8fd5df857c69dde3fa056 (diff)
Fix: If ConvertCMYKImagesToRGB was true, pdfwrite produced images with the
correct RGB data but with the color space still set to DeviceCMYK. (Fix originally from Helge Blischke.) git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@1623 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gdevpdfi.c')
-rw-r--r--gs/src/gdevpdfi.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gs/src/gdevpdfi.c b/gs/src/gdevpdfi.c
index a0b199fef..fbdcde133 100644
--- a/gs/src/gdevpdfi.c
+++ b/gs/src/gdevpdfi.c
@@ -270,10 +270,8 @@ pdf_begin_typed_image(gx_device_pdf *pdev, const gs_imager_state * pis,
in_line &= nbytes <= MAX_INLINE_IMAGE_BYTES;
if (rect.p.x != 0 || rect.p.y != 0 ||
rect.q.x != pim->Width || rect.q.y != pim->Height ||
- (is_mask ? pim->CombineWithColor :
- pdf_color_space(pdev, &cs_value, pcs,
- (in_line ? &pdf_color_space_names_short :
- &pdf_color_space_names), in_line) < 0)
+ (is_mask && pim->CombineWithColor)
+ /* Color space setup used to be done here: see SRZB comment below. */
) {
gs_free_object(mem, pie, "pdf_begin_image");
goto nyi;
@@ -313,11 +311,22 @@ pdf_begin_typed_image(gx_device_pdf *pdev, const gs_imager_state * pis,
psdf_setup_image_filters((gx_device_psdf *) pdev,
&pie->writer.binary, &image.pixel,
pmat, pis))) < 0 ||
+ /* SRZB 2001-04-25/Bl
+ * Since psdf_setup_image_filters may change the color space
+ * (in case of pdev->params.ConvertCMYKImagesToRGB == true),
+ * we postpone the selection of the PDF color space to here:
+ */
+ (!is_mask &&
+ pdf_color_space(pdev, &cs_value, image.pixel.ColorSpace,
+ (in_line ? &pdf_color_space_names_short :
+ &pdf_color_space_names), in_line) < 0) ||
(code = pdf_begin_image_data(pdev, &pie->writer,
(const gs_pixel_image_t *)&image,
&cs_value)) < 0
- )
+ ) {
+ /****** SHOULD FREE STRUCTURES AND CLEAN UP HERE ******/
return code;
+ }
return 0;
nyi:
return gx_default_begin_typed_image