diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-05-24 13:50:44 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-05-24 17:22:32 +0100 |
commit | e0a658dfc7ab6c199bb894f8a7cd66fe7bd72dfb (patch) | |
tree | 94bb327d3b48132eef7dfa5f90c4d0b41ddc06dd /source | |
parent | 37bcf35c71204d29a20a8be08741baf65870ac9c (diff) | |
download | mupdf-e0a658dfc7ab6c199bb894f8a7cd66fe7bd72dfb.tar.xz |
Skip alphas for "loaded" JPXs (where possible).
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/load-jpx.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c index 6a8c36c0..bcbdaaf3 100644 --- a/source/fitz/load-jpx.c +++ b/source/fitz/load-jpx.c @@ -204,7 +204,7 @@ fz_load_jpx(fz_context *ctx, unsigned char *data, int size, fz_colorspace *defcs fz_try(ctx) { - img = fz_new_pixmap(ctx, colorspace, w, h, 1); + img = fz_new_pixmap(ctx, colorspace, w, h, a); } fz_catch(ctx) { @@ -213,7 +213,7 @@ fz_load_jpx(fz_context *ctx, unsigned char *data, int size, fz_colorspace *defcs } p = img->samples; - stride = img->stride - w * (n + 1); + stride = img->stride - w * (n + a); for (y = 0; y < h; y++) { for (x = 0; x < w; x++) @@ -229,8 +229,6 @@ fz_load_jpx(fz_context *ctx, unsigned char *data, int size, fz_colorspace *defcs v = v << (8 - depth); *p++ = v; } - if (!a) - *p++ = 255; } p += stride; } |