about summary refs log tree commit diff
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
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
-rw-r--r--doc/HISTORY13
-rw-r--r--editor/pnmnorm.c2
-rw-r--r--other/pamdepth.c11
-rw-r--r--version.mk2
4 files changed, 23 insertions, 5 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 3ef64245..a60cd79c 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,9 +4,18 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+20.08.29 BJH  Release 10.91.02
+
+              pamdepth: fix bug: doesn't work on PAM with black and white
+              tuple type.
+
+              pnmnorm: Fix bug: output too dark when -bpercent and -wpercent
+              indicate overlapping values.  Broken since Netpbm 10.43 (June
+              2008).
+
 20.07.21 BJH  Release 10.91.01
 
-              pbmtext: fix double-free crash with -font .  Introduced in
+              pbmtext: Fix double-free crash with -font .  Introduced in
               Netpbm 10.91 (June 2020).
 
               pcdovtoppm: Fix some garbage from the conversion from csh to sh
@@ -21,7 +30,7 @@ CHANGE HISTORY
 
               pamstereogram: Add -tileable.  Thanks Scott Pakin.
 
-              pcdovtoppm: implement -version, -plain, and -quiet.
+              pcdovtoppm: Implement -version, -plain, and -quiet.
 
               pcdovtoppm: more secure temporary file handling.
 
diff --git a/editor/pnmnorm.c b/editor/pnmnorm.c
index e0fe0e35..20d7eb04 100644
--- a/editor/pnmnorm.c
+++ b/editor/pnmnorm.c
@@ -487,7 +487,7 @@ disOverlap(xelval   const reqBvalue,
             }
         } else {
             /* Both ends are free; use the point halfway between them. */
-            xelval const midPoint = (reqWvalue + reqBvalue + maxval/2)/2;
+            xelval const midPoint = (reqWvalue + reqBvalue)/2;
             *nonOlapBvalueP = MIN(midPoint, maxval-1);
             *nonOlapWvalueP = *nonOlapBvalueP + 1;
         }
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);
diff --git a/version.mk b/version.mk
index e1969226..3d6a805e 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 91
-NETPBM_POINT_RELEASE = 1
+NETPBM_POINT_RELEASE = 2