From 9ea6ca1c95f5dbfd4db20369618f095ded634027 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 9 Oct 2013 13:58:10 +0100 Subject: Fix typo in pixmap handling. When creating a png, a typo meant that we ALWAYS converted the pixmap even when we had an rgb or grayscale image on entry. Also, treat mask pixmaps (no colorspace) as gray. --- source/fitz/pixmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/fitz/pixmap.c b/source/fitz/pixmap.c index 8692a468..3c99d724 100644 --- a/source/fitz/pixmap.c +++ b/source/fitz/pixmap.c @@ -817,7 +817,7 @@ fz_image_as_png(fz_context *ctx, fz_image *image, int w, int h) fz_try(ctx) { - if (pix->colorspace != fz_device_gray(ctx) || pix->colorspace != fz_device_rgb(ctx)) + if (pix->colorspace && pix->colorspace != fz_device_gray(ctx) && pix->colorspace != fz_device_rgb(ctx)) { fz_pixmap *pix2 = fz_new_pixmap(ctx, fz_device_rgb(ctx), pix->w, pix->h); fz_convert_pixmap(ctx, pix2, pix); -- cgit v1.2.3