diff options
Diffstat (limited to 'other/pamdepth.c')
-rw-r--r-- | other/pamdepth.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/other/pamdepth.c b/other/pamdepth.c index 71dae9d8..96613d07 100644 --- a/other/pamdepth.c +++ b/other/pamdepth.c @@ -13,6 +13,7 @@ #include "pm_c_util.h" #include "mallocvar.h" +#include "nstring.h" #include "shhopt.h" #include "pam.h" @@ -157,11 +158,19 @@ main(int argc, const char * argv[]) { outpam.maxval = cmdline.newMaxval; if (PNM_FORMAT_TYPE(inpam.format) == PBM_TYPE) { - pm_message( "promoting from PBM to PGM" ); outpam.format = PGM_TYPE; } else outpam.format = inpam.format; + if (streq(inpam.tuple_type, PAM_PBM_TUPLETYPE)) { + pm_message("promoting from black and white to grayscale"); + strcpy(outpam.tuple_type, PAM_PGM_TUPLETYPE); + } else if (streq(inpam.tuple_type, PAM_PBM_ALPHA_TUPLETYPE)) { + pm_message("promoting from black and white to grayscale"); + strcpy(outpam.tuple_type, PAM_PGM_ALPHA_TUPLETYPE); + } else + strcpy(outpam.tuple_type, inpam.tuple_type); + pnm_writepaminit(&outpam); transformRaster(&inpam, &outpam); |