about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY5
-rw-r--r--editor/pamfunc.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 0294b4a4..85fb3ea0 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -11,7 +11,10 @@ not yet  BJH  Release 10.92.00
               pnmnorm: With bounds specified as -bpercent or -bsingle and
               -wpercent or -wsingle, and the image has only one brightness,
               don't attempt any normalization - leave image as is.  (Previous
-              version produce all black with -keephues).
+              version produces all black with -keephues).
+
+              pamfunc: Fix always wrong output with -not.  Always broken.
+              (-not was new in Netpbm 10.40 (September 2007)).
 
               pamdepth: fix bug: doesn't work on PAM with black and white
               tuple type.
diff --git a/editor/pamfunc.c b/editor/pamfunc.c
index 3c7b298d..03cf2a42 100644
--- a/editor/pamfunc.c
+++ b/editor/pamfunc.c
@@ -368,7 +368,7 @@ applyFunction(struct CmdlineInfo const cmdline,
                 outSample = inSample ^ cmdline.u.mask;
                 break;
             case FN_NOT:
-                outSample = ~inSample;
+                outSample = ~inSample & outpam.maxval;
                 break;
             case FN_SHIFTLEFT:
                 outSample =