From d53ab7a97c018aaa0e0adcaabcebcc72c080f724 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sat, 29 Oct 2016 15:53:58 +0800 Subject: 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. --- source/fitz/output-png.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/fitz/output-png.c') diff --git a/source/fitz/output-png.c b/source/fitz/output-png.c index 12eec89f..24e9394f 100644 --- a/source/fitz/output-png.c +++ b/source/fitz/output-png.c @@ -260,8 +260,7 @@ png_from_pixmap(fz_context *ctx, fz_pixmap *pix, int drop) { if (pix->colorspace && pix->colorspace != fz_device_gray(ctx) && pix->colorspace != fz_device_rgb(ctx)) { - pix2 = fz_new_pixmap(ctx, fz_device_rgb(ctx), pix->w, pix->h, pix->alpha); - fz_convert_pixmap(ctx, pix2, pix); + pix2 = fz_convert_pixmap(ctx, pix, fz_device_rgb(ctx), 1); if (drop) fz_drop_pixmap(ctx, pix); pix = pix2; -- cgit v1.2.3