summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-10-09 13:58:10 +0100
committerRobin Watts <robin.watts@artifex.com>2013-10-09 14:47:12 +0100
commit9ea6ca1c95f5dbfd4db20369618f095ded634027 (patch)
treed5ac5f0216373278a07657a3e216f795a6f113ac /source/fitz
parenta969156c500f599f3860dbf65fad7f8195a4ff34 (diff)
downloadmupdf-9ea6ca1c95f5dbfd4db20369618f095ded634027.tar.xz
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.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/pixmap.c2
1 files changed, 1 insertions, 1 deletions
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);