From 88f009ec79eb9b5d5773d7073523cb0aaaef6303 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 25 Oct 2017 17:40:37 +0100 Subject: Fix pgm corruption with spots files. When converting from a source space to a destination space with spots for our "overprint" group push, we were hitting problems in our use of the pixmap converters. Pixmap converters with copy_spots set can assume that the source and destination spots are the same - when copy spots is NOT set, we cannot assume this. This was leading us to have uninitialised group backgrounds. I believe we were only seeing this with pgm because of the device k to cmyk as K only special case. Also fix an error in the fast_gray_to_cmyk routine that failed to account for the change from subtractive to additive. --- source/fitz/colorspace.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source/fitz/colorspace.c') diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c index 1955cd10..e940478e 100644 --- a/source/fitz/colorspace.c +++ b/source/fitz/colorspace.c @@ -881,7 +881,7 @@ static void fast_gray_to_rgb(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz h = 1; } - if (ss == 0) + if (ss == 0 && ds == 0) { /* Common, no spots case */ if (da) @@ -1016,7 +1016,7 @@ static void fast_gray_to_cmyk(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, f h = 1; } - if (ss == 0) + if (ss == 0 && ds == 0) { /* Common, no spots case */ if (da) @@ -1113,7 +1113,7 @@ static void fast_gray_to_cmyk(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, f d[0] = 0; d[1] = 0; d[2] = 0; - d[3] = s[0]; + d[3] = 255 - s[0]; s += sn; d += dn; if (da) @@ -1156,7 +1156,7 @@ static void fast_rgb_to_gray(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz h = 1; } - if (ss == 0) + if (ss == 0 && ds == 0) { /* Common, no spots case */ if (da) @@ -1281,7 +1281,7 @@ static void fast_bgr_to_gray(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz h = 1; } - if (ss == 0) + if (ss == 0 && ds == 0) { /* Common, no spots case */ if (da) @@ -1409,7 +1409,7 @@ static void fast_rgb_to_cmyk(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz h = 1; } - if (ss == 0) + if (ss == 0 && ds == 0) { /* Common, no spots case */ if (da) @@ -1569,7 +1569,7 @@ static void fast_bgr_to_cmyk(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz h = 1; } - if (ss == 0) + if (ss == 0 && ds == 0) { /* Common, no spots case */ if (da) @@ -1729,7 +1729,7 @@ static void fast_cmyk_to_gray(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, f h = 1; } - if (ss == 0) + if (ss == 0 && ds == 0) { /* Common, no spots case */ if (da) @@ -2206,7 +2206,7 @@ static void fast_cmyk_to_rgb(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz h = 1; } - if (ss == 0) + if (ss == 0 && ds == 0) { /* Common, no spots case */ if (da) @@ -2364,7 +2364,7 @@ static void fast_cmyk_to_bgr(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz h = 1; } - if (ss == 0) + if (ss == 0 && ds == 0) { /* Common, no spots case */ if (da) @@ -2508,7 +2508,7 @@ static void fast_rgb_to_bgr(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz_ h = 1; } - if (ss == 0) + if (ss == 0 && ds == 0) { /* Common, no spots case */ if (da) -- cgit v1.2.3