summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-01-06 13:36:13 +0000
committerRobin Watts <robin@ghostscript.com>2012-01-06 13:49:24 +0000
commit8148a49342243c4a4dfd2aece347a45606cdac00 (patch)
tree34007d9fbb1ed782ed4b82d29148805461c8edde /pdf
parent8e6accf516d719669989cfc70f824ed56e2ec60b (diff)
downloadmupdf-8148a49342243c4a4dfd2aece347a45606cdac00.tar.xz
Ignore decode arrays for indexed jpx images.
We can't do them properly at the moment, so don't try to do them at all - only makes stuff worse for now. Thanks to Zeniko for this.
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdf_image.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pdf/pdf_image.c b/pdf/pdf_image.c
index dd2a5a87..33e6077d 100644
--- a/pdf/pdf_image.c
+++ b/pdf/pdf_image.c
@@ -305,6 +305,7 @@ pdf_load_jpx_image(pdf_xref *xref, fz_obj *dict)
fz_pixmap *img = NULL;
fz_obj *obj;
fz_context *ctx = xref->ctx;
+ int indexed = 0;
fz_var(img);
fz_var(buf);
@@ -313,6 +314,7 @@ pdf_load_jpx_image(pdf_xref *xref, fz_obj *dict)
buf = pdf_load_stream(xref, fz_to_num(dict), fz_to_gen(dict));
/* RJW: "cannot load jpx image data" */
+ /* FIXME: We can't handle decode arrays for indexed images currently */
fz_try(ctx)
{
obj = fz_dict_gets(dict, "ColorSpace");
@@ -320,6 +322,7 @@ pdf_load_jpx_image(pdf_xref *xref, fz_obj *dict)
{
colorspace = pdf_load_colorspace(xref, obj);
/* RJW: "cannot load image colorspace" */
+ indexed = !strcmp(colorspace->name, "Indexed");
}
img = fz_load_jpx_image(ctx, buf->data, buf->len, colorspace);
@@ -341,7 +344,7 @@ pdf_load_jpx_image(pdf_xref *xref, fz_obj *dict)
}
obj = fz_dict_getsa(dict, "Decode", "D");
- if (obj)
+ if (obj && !indexed)
{
float decode[FZ_MAX_COLORS * 2];
int i;