summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-06-28 18:56:18 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-06-29 11:10:08 +0200
commitdf3c7813c7e185006dd0c6fc1a30dbcf31b716c4 (patch)
tree390303cef079d04f3302ab0b76438e4560447f94 /source/fitz
parent363f51b35f351009c1eabffeee6a410ba1f38e14 (diff)
downloadmupdf-df3c7813c7e185006dd0c6fc1a30dbcf31b716c4.tar.xz
Handle alpha-only PAM output as grayscale.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/output-pnm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/fitz/output-pnm.c b/source/fitz/output-pnm.c
index 0721c08d..2d1acd23 100644
--- a/source/fitz/output-pnm.c
+++ b/source/fitz/output-pnm.c
@@ -127,7 +127,8 @@ fz_write_pam_header(fz_context *ctx, fz_output *out, int w, int h, int n, int al
n -= alpha;
- if (n == 1 && !alpha) fz_printf(ctx, out, "TUPLTYPE GRAYSCALE\n");
+ if (n == 0 && alpha) fz_printf(ctx, out, "TUPLTYPE GRAYSCALE\n");
+ else if (n == 1 && !alpha) fz_printf(ctx, out, "TUPLTYPE GRAYSCALE\n");
else if (n == 1 && alpha) fz_printf(ctx, out, "TUPLTYPE GRAYSCALE_ALPHA\n");
else if (n == 3 && !alpha) fz_printf(ctx, out, "TUPLTYPE RGB\n");
else if (n == 3 && alpha) fz_printf(ctx, out, "TUPLTYPE RGB_ALPHA\n");