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/tools/pdfextract.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source/tools') diff --git a/source/tools/pdfextract.c b/source/tools/pdfextract.c index e8e03965..ff26229d 100644 --- a/source/tools/pdfextract.c +++ b/source/tools/pdfextract.c @@ -38,9 +38,7 @@ static void writepixmap(fz_context *ctx, fz_pixmap *pix, char *file, int dorgb) if (dorgb && pix->colorspace && pix->colorspace != fz_device_rgb(ctx)) { - fz_irect bbox; - rgb = fz_new_pixmap_with_bbox(ctx, fz_device_rgb(ctx), fz_pixmap_bbox(ctx, pix, &bbox), pix->alpha); - fz_convert_pixmap(ctx, rgb, pix); + rgb = fz_convert_pixmap(ctx, pix, fz_device_rgb(ctx), 1); pix = rgb; } -- cgit v1.2.3