summaryrefslogtreecommitdiff
path: root/fitz/filt_jpxd.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-07-30 12:14:36 +0000
committerTor Andersson <tor@ghostscript.com>2010-07-30 12:14:36 +0000
commite2823074458016584251b962f23ae7fc0b707b32 (patch)
treef5d99633e074c8a81bfee58cb096f0646ca4eaeb /fitz/filt_jpxd.c
parent4f49317deff939df854a8d9fecd7502cf2b4c9b2 (diff)
downloadmupdf-e2823074458016584251b962f23ae7fc0b707b32.tar.xz
Refactor image loading.
Diffstat (limited to 'fitz/filt_jpxd.c')
-rw-r--r--fitz/filt_jpxd.c9
1 files changed, 2 insertions, 7 deletions
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;
}