summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-interpret.c
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2013-08-30 22:09:27 +0200
committerRobin Watts <robin.watts@artifex.com>2013-09-10 14:09:03 +0100
commit6904674fceaa8b289ef70b692ffa2aa7f7afb726 (patch)
treeac376ea8970e8feee8344b1cf1a3c219cf5f5500 /source/pdf/pdf-interpret.c
parentef983195f1c593f8aa01a484cd2e9b26ce7923ae (diff)
downloadmupdf-6904674fceaa8b289ef70b692ffa2aa7f7afb726.tar.xz
correctly set indexed colors in pdf_set_color
Required for 1879_-_Indexed_colors_wrongly_converted.pdf Also, removing broken code in the same place (where mat->v[] is overwritten right after being set in the L*a*b* case).
Diffstat (limited to 'source/pdf/pdf-interpret.c')
-rw-r--r--source/pdf/pdf-interpret.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/pdf/pdf-interpret.c b/source/pdf/pdf-interpret.c
index 9de4c833..b498d54d 100644
--- a/source/pdf/pdf-interpret.c
+++ b/source/pdf/pdf-interpret.c
@@ -1270,11 +1270,10 @@ pdf_set_color(pdf_csi *csi, int what, float *v)
{
case PDF_MAT_PATTERN:
case PDF_MAT_COLOR:
- if (!strcmp(mat->colorspace->name, "Lab"))
+ if (fz_colorspace_is_indexed(mat->colorspace))
{
- mat->v[0] = v[0] / 100;
- mat->v[1] = (v[1] + 100) / 200;
- mat->v[2] = (v[2] + 100) / 200;
+ mat->v[0] = v[0] / 255;
+ break;
}
for (i = 0; i < mat->colorspace->n; i++)
mat->v[i] = v[i];