From cf9a5e5e7af55d15a83f542041fc63c73ba57425 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 1 Jan 2014 12:59:08 +0000 Subject: Cull code unused as a result of the "tolerate inline images..." fix. Remove code that's not used any more as a result of the previous fix, plus some code that was unused anyway. --- source/pdf/pdf-image.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'source/pdf') diff --git a/source/pdf/pdf-image.c b/source/pdf/pdf-image.c index f3f63d65..b22f39fb 100644 --- a/source/pdf/pdf-image.c +++ b/source/pdf/pdf-image.c @@ -18,6 +18,7 @@ pdf_load_image_imp(pdf_document *doc, pdf_obj *rdb, pdf_obj *dict, fz_stream *cs fz_colorspace *colorspace = NULL; float decode[FZ_MAX_COLORS * 2]; int colorkey[FZ_MAX_COLORS * 2]; + int stride; int i; fz_context *ctx = doc->ctx; @@ -133,7 +134,7 @@ pdf_load_image_imp(pdf_document *doc, pdf_obj *rdb, pdf_obj *dict, fz_stream *cs } /* Now, do we load a ref, or do we load the actual thing? */ - if (!cstm) + if (cstm == NULL) { /* Just load the compressed image data now and we can * decode it on demand. */ @@ -145,20 +146,13 @@ pdf_load_image_imp(pdf_document *doc, pdf_obj *rdb, pdf_obj *dict, fz_stream *cs } /* We need to decompress the image now */ - if (cstm) - { - int stride = (w * n * bpc + 7) / 8; - stm = pdf_open_inline_stream(doc, dict, stride * h, cstm, NULL); - } - else - { - stm = pdf_open_stream(doc, pdf_to_num(dict), pdf_to_gen(dict)); - } + stride = (w * n * bpc + 7) / 8; + stm = pdf_open_inline_stream(doc, dict, stride * h, cstm, NULL); image = fz_new_image(ctx, w, h, bpc, colorspace, 96, 96, interpolate, imagemask, decode, usecolorkey ? colorkey : NULL, NULL, mask); colorspace = NULL; mask = NULL; - image->tile = fz_decomp_image_from_stream(ctx, stm, image, cstm != NULL, indexed, 0, 0); + image->tile = fz_decomp_image_from_stream(ctx, stm, image, indexed, 0, 0); } fz_catch(ctx) { -- cgit v1.2.3