diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-06-30 15:21:56 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-07-06 13:34:37 +0200 |
commit | 255776a778b519183d6935ff0cb4b766644fa830 (patch) | |
tree | 16c2d411870b31cc25a2941d90ca862c10083667 /source/pdf/pdf-image.c | |
parent | b644ed1360d0e47c03a637bbc568000d57d0cdbf (diff) | |
download | mupdf-255776a778b519183d6935ff0cb4b766644fa830.tar.xz |
pdf: Drop generation number from public interfaces.
The generation number is only needed for decryption, and is assumed
to be zero or irrelevant for all other uses.
Store the original object number and generation in the xref slot, so
that we can decrypt them even when the objects have been renumbered,
without needing to pass the original object number around through
the stream loading APIs.
Diffstat (limited to 'source/pdf/pdf-image.c')
-rw-r--r-- | source/pdf/pdf-image.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/pdf/pdf-image.c b/source/pdf/pdf-image.c index 3bba27ad..50d29e93 100644 --- a/source/pdf/pdf-image.c +++ b/source/pdf/pdf-image.c @@ -156,11 +156,8 @@ pdf_load_image_imp(fz_context *ctx, pdf_document *doc, pdf_obj *rdb, pdf_obj *di /* Do we load from a ref, or do we load an inline stream? */ if (cstm == NULL) { - /* Just load the compressed image data now and we can - * decode it on demand. */ - int num = pdf_to_num(ctx, dict); - int gen = pdf_to_gen(ctx, dict); - buffer = pdf_load_compressed_stream(ctx, doc, num, gen); + /* Just load the compressed image data now and we can decode it on demand. */ + buffer = pdf_load_compressed_stream(ctx, doc, pdf_to_num(ctx, dict)); image = fz_new_image_from_compressed_buffer(ctx, w, h, bpc, colorspace, 96, 96, interpolate, imagemask, decode, use_colorkey ? colorkey : NULL, buffer, mask); image->invert_cmyk_jpeg = 0; } @@ -224,7 +221,7 @@ pdf_load_jpx(fz_context *ctx, pdf_document *doc, pdf_obj *dict, int forcemask) fz_var(colorspace); fz_var(mask); - buf = pdf_load_stream(ctx, doc, pdf_to_num(ctx, dict), pdf_to_gen(ctx, dict)); + buf = pdf_load_stream(ctx, doc, pdf_to_num(ctx, dict)); /* FIXME: We can't handle decode arrays for indexed images currently */ fz_try(ctx) |