summaryrefslogtreecommitdiff
path: root/source/fitz/load-jxr.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-10-29 15:53:58 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-12-14 20:36:25 +0100
commitd53ab7a97c018aaa0e0adcaabcebcc72c080f724 (patch)
treee0627cf3dcfb6c286bfadf9dedc40547875083e6 /source/fitz/load-jxr.c
parent5ad76a1961559904bbb9312d92dd15c3ed0c67b5 (diff)
downloadmupdf-d53ab7a97c018aaa0e0adcaabcebcc72c080f724.tar.xz
Let pixmap colorspace conversion create new pixmap.
This moves dropping the converted pixmap into fz_convert_pixmap(), which relieves every caller from doing so. Moreover resolution, position and interpolation are kept.
Diffstat (limited to 'source/fitz/load-jxr.c')
-rw-r--r--source/fitz/load-jxr.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/source/fitz/load-jxr.c b/source/fitz/load-jxr.c
index e61d6e7a..8bff2833 100644
--- a/source/fitz/load-jxr.c
+++ b/source/fitz/load-jxr.c
@@ -413,19 +413,7 @@ fz_load_jxr(fz_context *ctx, unsigned char *data, size_t size)
/* CMYK is a subtractive colorspace, we want additive for premul alpha */
if (info.comps >= 4)
{
- fz_pixmap *rgb = fz_new_pixmap(ctx, fz_device_rgb(ctx), image->w, image->h, 1);
-
- rgb->xres = image->xres;
- rgb->yres = image->yres;
-
- fz_try(ctx)
- fz_convert_pixmap(ctx, rgb, image);
- fz_catch(ctx)
- {
- fz_drop_pixmap(ctx, rgb);
- fz_rethrow(ctx);
- }
-
+ fz_pixmap *rgb = fz_convert_pixmap(ctx, image, fz_device_rgb(ctx), 1);
fz_drop_pixmap(ctx, image);
image = rgb;
}