diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2017-09-16 17:19:44 -0500 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2017-10-24 15:16:36 +0100 |
commit | a1e696d27e0927855dd2e0d505afd571b0f37ed7 (patch) | |
tree | d35616a9414bc9adfc135edaeda9a0707af66b77 | |
parent | c40b136f4ecb78a481326a544b56eb7be251445c (diff) | |
download | mupdf-a1e696d27e0927855dd2e0d505afd571b0f37ed7.tar.xz |
Fix some Ghent overprint test files.
Fix Ghent_V3.0/070_OutputIntent_ISOCoated-v1_x3.pdf.
Partially Fix Ghent_V5.0/GWG190_DeviceN_Overprint_Black_X1a.pdf
Cope with 'All' and 'None' colorants. Files with 'All' and 'None'
colorants can still count as being "entirely CMYK" for the purposes
of color conversion.
There is a still an overprint problem with the 3rd swatch of
Ghent_V5.0/GWG190_DeviceN_Overprint_Black_X1a.pdf.
-rw-r--r-- | source/fitz/draw-device.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index 836fc4df..8adef1a3 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -360,8 +360,35 @@ colors_supported(fz_context *ctx, fz_colorspace *cs, fz_pixmap *dest) /* If our destination is CMYK and the source color space is only C, M, Y or K we support it * even if we have no seps */ - if (fz_colorspace_is_subtractive(ctx, dest->colorspace) && fz_colorspace_device_n_has_only_cmyk(ctx, cs)) + if (fz_colorspace_is_subtractive(ctx, dest->colorspace)) + { + int i, n; + if (fz_colorspace_device_n_has_only_cmyk(ctx, cs)) + return 1; + + n = fz_colorspace_n(ctx, cs); + for (i = 0; i < n; i++) + { + const char *name = fz_colorspace_colorant(ctx, cs, i); + + if (!name) + return 0; + if (!strcmp(name, "All")) + continue; + if (!strcmp(name, "Cyan")) + continue; + if (!strcmp(name, "Magenta")) + continue; + if (!strcmp(name, "Yellow")) + continue; + if (!strcmp(name, "Black")) + continue; + if (!strcmp(name, "None")) + continue; + return 0; + } return 1; + } return 0; } @@ -388,11 +415,13 @@ set_op_from_spaces(fz_context *ctx, fz_overprint *op, const fz_pixmap *dest, con */ for (j = 0; j < sn; j++) { + /* Run through the colorants looking for one that isn't mentioned. + * i.e. continue if we we find one, break if not. */ const char *sname = fz_colorspace_colorant(ctx, src, j); if (!sname) - continue; - if (!strcmp(sname, "All")) break; + if (!strcmp(sname, "All") || !strcmp(sname, "None")) + continue; for (i = 0; i < dc; i++) { const char *name = fz_colorspace_colorant(ctx, dest->colorspace, i); |