diff options
-rw-r--r-- | doc/HISTORY | 5 | ||||
-rw-r--r-- | editor/pamfunc.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/doc/HISTORY b/doc/HISTORY index c4caa57c..fd0113be 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -34,8 +34,9 @@ not yet BJH Release 10.92.00 pamarith: Fix crash with -compare where inputs are PBM. Broken in Netpbm 10.14 (February 2003). - pamfunc: Fix crash with -changemaxval and PBM input. Always - broken. -changemaxval was new in Netpbm 10.65 (December 2013). + pamfunc: Fix crash with -changemaxval and PBM or BLACKANDWHITE + PAM input. Always broken. -changemaxval was new in Netpbm + 10.65 (December 2013). pcdovtoppm: Fix some garbage from the conversion from csh to sh in Netpbm 9.12 (March 2001) in conversion from csh arrays that diff --git a/editor/pamfunc.c b/editor/pamfunc.c index 1b59a398..b85cfe9b 100644 --- a/editor/pamfunc.c +++ b/editor/pamfunc.c @@ -20,6 +20,7 @@ #include "pm_c_util.h" #include "mallocvar.h" +#include "nstring.h" #include "shhopt.h" #include "pam.h" @@ -422,6 +423,9 @@ main(int argc, const char *argv[]) { planTransform(cmdline, inpam.maxval, outpam.format, &outpam.maxval, &mustChangeRaster); + if (outpam.maxval > 1 && strneq(outpam.tuple_type, "BLACKANDWHITE", 13)) + strcpy(outpam.tuple_type, ""); + pnm_writepaminit(&outpam); outputRow = pnm_allocpamrow(&outpam); |