summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/fitz/output-pnm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/fitz/output-pnm.c b/source/fitz/output-pnm.c
index b2bc2387..8310de9b 100644
--- a/source/fitz/output-pnm.c
+++ b/source/fitz/output-pnm.c
@@ -124,9 +124,9 @@ fz_write_pam_header(fz_context *ctx, fz_output *out, int w, int h, int n, int al
fz_printf(ctx, out, "HEIGHT %d\n", h);
fz_printf(ctx, out, "DEPTH %d\n", n);
fz_printf(ctx, out, "MAXVAL 255\n");
- if (n == 1) fz_printf(ctx, out, "TUPLTYPE GRAYSCALE\n");
+ 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) fz_printf(ctx, out, "TUPLTYPE RGB\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");
else if (n == 4 && !alpha) fz_printf(ctx, out, "TUPLTYPE CMYK\n");
else if (n == 5) fz_printf(ctx, out, "TUPLTYPE CMYK_ALPHA\n");