summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2013-09-25 15:47:32 +0200
committerRobin Watts <robin.watts@artifex.com>2013-09-27 17:09:46 +0100
commitab567929dbbb62237e4598f9c1b6a8231431305c (patch)
treeba9feacfa8fcf08cbf4d151118731fded6aa0f8a /source
parent4c6b5be38d6ac65f81086843a42a186ed1df379c (diff)
downloadmupdf-ab567929dbbb62237e4598f9c1b6a8231431305c.tar.xz
don't color transform RGB JPEG-in-TIFF images
TIFF images containing JPEG data only require color transformation for CYMK data streams. For RGB streams, this could lead to unexpected results.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/load-tiff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/fitz/load-tiff.c b/source/fitz/load-tiff.c
index f473802b..2850e278 100644
--- a/source/fitz/load-tiff.c
+++ b/source/fitz/load-tiff.c
@@ -188,9 +188,12 @@ fz_decode_tiff_jpeg(struct tiff *tiff, fz_stream *chain, unsigned char *wp, int
{
fz_stream *stm;
fz_stream *jpegtables = NULL;
+ int color_transform = -1; /* unset */
if (tiff->jpegtables && (int)tiff->jpegtableslen > 0)
jpegtables = fz_open_memory(tiff->ctx, tiff->jpegtables, (int)tiff->jpegtableslen);
- stm = fz_open_dctd(chain, -1, 0, jpegtables);
+ if (tiff->photometric == 2 /* RGB */ || tiff->photometric == 3 /* RGBPal */)
+ color_transform = 0;
+ stm = fz_open_dctd(chain, color_transform, 0, jpegtables);
fz_read(stm, wp, wlen);
fz_close(stm);
}