From d11a38dbd783b746d7a35f03fecfb3cbca65527e Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 19 Mar 2012 15:19:17 +0000 Subject: Bug 692746; avoid 'double palettes' on jpx images. It seems that JPX images can be supplied in indexed format, with both a palette internal to the jpx stream, and a palette in the PDF. Googling seems to suggest that the internal palette should be ignored in this case, and the external palette applied. Fortunately, since OpenJPEG-1.5 there is a flag that can be used to tell OpenJPEG not to decode palettes. We update the code here to spot that there is an external palette, and to set this flag. --- pdf/pdf_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pdf') diff --git a/pdf/pdf_image.c b/pdf/pdf_image.c index 17996a74..dc9cc088 100644 --- a/pdf/pdf_image.c +++ b/pdf/pdf_image.c @@ -504,7 +504,7 @@ pdf_load_jpx(pdf_document *xref, pdf_obj *dict, pdf_image *image) indexed = !strcmp(colorspace->name, "Indexed"); } - img = fz_load_jpx(ctx, buf->data, buf->len, colorspace); + img = fz_load_jpx(ctx, buf->data, buf->len, colorspace, indexed); /* RJW: "cannot load jpx image" */ if (img && colorspace == NULL) -- cgit v1.2.3