summaryrefslogtreecommitdiff
path: root/source/fitz/load-tiff.c
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2013-08-30 16:07:53 +0200
committerRobin Watts <robin.watts@artifex.com>2013-09-10 14:09:02 +0100
commitfa56dd76da7aa65862ee1db0b1147c899f2e8144 (patch)
treef94efe8801a8137cb159ca967e972344ce340020 /source/fitz/load-tiff.c
parent527afcaa0744472d7ad2ef84ce79ab34a036ad85 (diff)
downloadmupdf-fa56dd76da7aa65862ee1db0b1147c899f2e8144.tar.xz
support jpegtables for TIFF images
This is required e.g. for 2314 - jpeg tables in tiff.xps. This folds fz_open_resized_dct back into fz_open_dct instead of adding further variations for calls with and without the jpegtables argument.
Diffstat (limited to 'source/fitz/load-tiff.c')
-rw-r--r--source/fitz/load-tiff.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/fitz/load-tiff.c b/source/fitz/load-tiff.c
index a7d10d00..fbe84740 100644
--- a/source/fitz/load-tiff.c
+++ b/source/fitz/load-tiff.c
@@ -186,7 +186,11 @@ fz_decode_tiff_fax(struct tiff *tiff, int comp, fz_stream *chain, unsigned char
static void
fz_decode_tiff_jpeg(struct tiff *tiff, fz_stream *chain, unsigned char *wp, int wlen)
{
- fz_stream *stm = fz_open_dctd(chain, -1);
+ fz_stream *stm;
+ fz_stream *jpegtables = NULL;
+ 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);
fz_read(stm, wp, wlen);
fz_close(stm);
}
@@ -660,7 +664,6 @@ fz_read_tiff_tag(struct tiff *tiff, unsigned offset)
break;
case JPEGTables:
- fz_warn(tiff->ctx, "jpeg tables in tiff not implemented");
tiff->jpegtables = tiff->bp + value;
tiff->jpegtableslen = count;
break;