about summary refs log tree commit diff
path: root/other/pamdepth.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-08-29 04:27:26 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-08-29 04:27:26 +0000
commitee22a387e358e3504dd193e5dd1445ca727034f6 (patch)
treebda2b5d8127beb68c3c3daeb94c6498430ce8ae1 /other/pamdepth.c
parentff0477668376efc94077f311f2965e8490d88a78 (diff)
downloadnetpbm-mirror-ee22a387e358e3504dd193e5dd1445ca727034f6.tar.gz
netpbm-mirror-ee22a387e358e3504dd193e5dd1445ca727034f6.tar.xz
netpbm-mirror-ee22a387e358e3504dd193e5dd1445ca727034f6.zip
Release 10.91.02
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3932 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'other/pamdepth.c')
-rw-r--r--other/pamdepth.c11
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);