summaryrefslogtreecommitdiff
path: root/pdf/pdf_image.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-11-15 19:22:30 +0000
committerRobin Watts <robin.watts@artifex.com>2011-11-17 18:32:07 +0000
commit8f8794063127610db433c5dd0f6e7f5241308c6f (patch)
tree8a80276607927a35aa90111749f80139d9002ef1 /pdf/pdf_image.c
parent2be04fd23c9650820fa5abd1196647ccf1b73921 (diff)
downloadmupdf-8f8794063127610db433c5dd0f6e7f5241308c6f.tar.xz
Bug 692478: Honour decode arrays for jpx images
Add simple code to read decode array and apply it to a jpx image after loading. Solves bug.
Diffstat (limited to 'pdf/pdf_image.c')
-rw-r--r--pdf/pdf_image.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pdf/pdf_image.c b/pdf/pdf_image.c
index e1901100..50292092 100644
--- a/pdf/pdf_image.c
+++ b/pdf/pdf_image.c
@@ -329,6 +329,18 @@ pdf_load_jpx_image(fz_pixmap **imgp, pdf_xref *xref, fz_obj *dict)
}
}
+ obj = fz_dict_getsa(dict, "Decode", "D");
+ if (obj)
+ {
+ float decode[FZ_MAX_COLORS * 2];
+ int i;
+
+ for (i = 0; i < img->n * 2; i++)
+ decode[i] = fz_to_real(fz_array_get(obj, i));
+
+ fz_decode_tile(img, decode);
+ }
+
*imgp = img;
return fz_okay;
}