diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-06-28 17:21:21 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-06-28 17:21:21 +0000 |
commit | 0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0 (patch) | |
tree | 3e8db9f13fb33464324c6986e7d80540a42a86c7 /other/pamdepth.c | |
parent | 7dd37058c4c8e0f6ca272e329162a52f958e4951 (diff) | |
download | netpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.tar.gz netpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.tar.xz netpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.zip |
promote Stable to Super Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@4557 9d0c8265-081b-0410-96cb-a4ca84ce46f8
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); |