summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-image.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/pdf/pdf-image.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/pdf/pdf-image.c')
-rw-r--r--source/pdf/pdf-image.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/source/pdf/pdf-image.c b/source/pdf/pdf-image.c
index 141ee171..11ab856f 100644
--- a/source/pdf/pdf-image.c
+++ b/source/pdf/pdf-image.c
@@ -43,19 +43,9 @@ pdf_load_image_imp(fz_context *ctx, pdf_document *doc, pdf_obj *rdb, pdf_obj *di
if (tile->n != 1)
{
fz_pixmap *gray;
- fz_irect bbox;
if (tile->n != 2)
fz_warn(ctx, "soft mask should be grayscale");
- gray = fz_new_pixmap_with_bbox(ctx, fz_device_gray(ctx), fz_pixmap_bbox(ctx, tile, &bbox), 0);
-
- fz_try(ctx)
- fz_convert_pixmap(ctx, gray, tile);
- fz_catch(ctx)
- {
- fz_drop_pixmap(ctx, gray);
- fz_rethrow(ctx);
- }
-
+ gray = fz_convert_pixmap(ctx, tile, fz_device_gray(ctx), 0);
fz_drop_pixmap(ctx, tile);
tile = gray;
}