diff options
author | Simon Bünzli <zeniko@gmail.com> | 2013-09-26 17:39:10 +0200 |
---|---|---|
committer | Simon Bünzli <zeniko@gmail.com> | 2013-09-27 16:24:25 +0200 |
commit | 2c615e5aa18c7a34118605774de70b6b65f04b19 (patch) | |
tree | 787b923b7327f6e45093bd1f65e616961a1215e3 /source | |
parent | a9c8633ee803201bac4907b9f633a56c32051675 (diff) | |
download | mupdf-2c615e5aa18c7a34118605774de70b6b65f04b19.tar.xz |
fix bug 694618
For Separation and DeviceN colorspaces, the initial color value is 1.0
for all components instead of 0.0 as for most other colorspaces. The
current initialization in pdf_set_colorspace initializes for CMYK which
happens to work for all non-tint colorspaces.
Diffstat (limited to 'source')
-rw-r--r-- | source/pdf/pdf-colorspace.c | 8 | ||||
-rw-r--r-- | source/pdf/pdf-interpret.c | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/source/pdf/pdf-colorspace.c b/source/pdf/pdf-colorspace.c index 9ade1a71..611a187b 100644 --- a/source/pdf/pdf-colorspace.c +++ b/source/pdf/pdf-colorspace.c @@ -167,6 +167,14 @@ load_separation(pdf_document *doc, pdf_obj *array) return cs; } +int +pdf_is_tint_colorspace(fz_colorspace *cs) +{ + return cs && cs->to_rgb == separation_to_rgb; +} + +/* Indexed */ + static fz_colorspace * load_indexed(pdf_document *doc, pdf_obj *array) { diff --git a/source/pdf/pdf-interpret.c b/source/pdf/pdf-interpret.c index b498d54d..3790578f 100644 --- a/source/pdf/pdf-interpret.c +++ b/source/pdf/pdf-interpret.c @@ -1252,6 +1252,13 @@ pdf_set_colorspace(pdf_csi *csi, int what, fz_colorspace *colorspace) mat->v[1] = 0; mat->v[2] = 0; mat->v[3] = 1; + + if (pdf_is_tint_colorspace(colorspace)) + { + int i; + for (i = 0; i < colorspace->n; i++) + mat->v[i] = 1.0f; + } } static void |