diff options
author | Robin Watts <robin.watts@artifex.com> | 2017-09-25 17:22:48 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2017-10-24 15:16:37 +0100 |
commit | c8376f966de15dac704666cc7446366328ea8737 (patch) | |
tree | 3827189ddeb042a41195525e8f920a41b11551f6 /source | |
parent | c153ffd054c91f4a68c5df309d2b647dad6609de (diff) | |
download | mupdf-c8376f966de15dac704666cc7446366328ea8737.tar.xz |
Don't override non-default Device{Gray,RGB,CMYK} by OI.
If the OutputIntent is set, we used to set Device{Gray,RGB,CMYK}
(as appopriate) to match it. Don't do this if it's already
been set to something other than our defaults.
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/colorspace.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c index 1692a439..4dc4b542 100644 --- a/source/fitz/colorspace.c +++ b/source/fitz/colorspace.c @@ -3822,16 +3822,25 @@ fz_set_default_output_intent(fz_context *ctx, fz_default_colorspaces *default_cs switch (cs->n) { case 1: - fz_drop_colorspace(ctx, default_cs->gray); - default_cs->gray = fz_keep_colorspace(ctx, cs); + if (default_cs->gray == fz_device_gray(ctx)) + { + fz_drop_colorspace(ctx, default_cs->gray); + default_cs->gray = fz_keep_colorspace(ctx, cs); + } break; case 3: - fz_drop_colorspace(ctx, default_cs->rgb); - default_cs->rgb = fz_keep_colorspace(ctx, cs); + if (default_cs->rgb == fz_device_rgb(ctx)) + { + fz_drop_colorspace(ctx, default_cs->rgb); + default_cs->rgb = fz_keep_colorspace(ctx, cs); + } break; case 4: - fz_drop_colorspace(ctx, default_cs->cmyk); - default_cs->cmyk = fz_keep_colorspace(ctx, cs); + if (default_cs->cmyk == fz_device_cmyk(ctx)) + { + fz_drop_colorspace(ctx, default_cs->cmyk); + default_cs->cmyk = fz_keep_colorspace(ctx, cs); + } break; } } |