From e2823074458016584251b962f23ae7fc0b707b32 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 30 Jul 2010 12:14:36 +0000 Subject: Refactor image loading. --- fitz/filt_jpxd.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'fitz') diff --git a/fitz/filt_jpxd.c b/fitz/filt_jpxd.c index f4530ad5..a78d0932 100644 --- a/fitz/filt_jpxd.c +++ b/fitz/filt_jpxd.c @@ -38,8 +38,6 @@ pdf_loadjpximage(pdf_image **imgp, pdf_xref *xref, fz_obj *rdb, fz_obj *dict) int n, w, h, depth, sgnd; int x, y, k, v; - pdf_logimage("load jpx image (%d %d R) {\n", fz_tonum(dict), fz_togen(dict)); - error = pdf_loadstream(&buf, xref, fz_tonum(dict), fz_togen(dict)); if (error) return fz_throw("read error in jpx image"); @@ -102,8 +100,7 @@ pdf_loadjpximage(pdf_image **imgp, pdf_xref *xref, fz_obj *rdb, fz_obj *dict) img->bpc = 8; img->n = n; img->stride = w * n; - img->samples = fz_newbuffer(w * n * h); - img->samples->len = img->samples->cap; + img->samples = fz_malloc(w * n * h); switch (n) { @@ -119,7 +116,7 @@ pdf_loadjpximage(pdf_image **imgp, pdf_xref *xref, fz_obj *rdb, fz_obj *dict) img->decode[k * 2 + 1] = 1; } - p = img->samples->data; + p = img->samples; for (y = 0; y < h; y++) { for (x = 0; x < w; x++) @@ -138,8 +135,6 @@ pdf_loadjpximage(pdf_image **imgp, pdf_xref *xref, fz_obj *rdb, fz_obj *dict) opj_image_destroy(jpx); - pdf_logimage("}\n"); - *imgp = img; return fz_okay; } -- cgit v1.2.3