about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-12-08 02:49:50 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-12-08 02:49:50 +0000
commit86aef68b580c08274ffe0b26f58b36f88b3220a5 (patch)
treec010dfd6426e53c13f5b47dabd220c240b5cd4eb
parent7a850eac297d9946f46f24a70e35a3e614917981 (diff)
downloadnetpbm-mirror-86aef68b580c08274ffe0b26f58b36f88b3220a5.tar.gz
netpbm-mirror-86aef68b580c08274ffe0b26f58b36f88b3220a5.tar.xz
netpbm-mirror-86aef68b580c08274ffe0b26f58b36f88b3220a5.zip
Fix garbage output with type -impulse
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3995 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--doc/HISTORY4
-rw-r--r--editor/pamaddnoise.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 776b3af8..1f5d3c87 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -15,6 +15,10 @@ not yet  BJH  Release 10.93.00
               pamrith: fail if operand images have different depth and not
               depth 1.
 
+              pamaddnoise: fix bug: garbage output with -type impulse.  Always
+              broken (pamaddnoise's precursors pnmaddnoise was new to Netpbm
+              in Netpbm 10.29 (August 2005).
+
 20.09.26 BJH  Release 10.92.00
 
               pnmcrop: Make -margin effective with -blank-image=minimize.
diff --git a/editor/pamaddnoise.c b/editor/pamaddnoise.c
index 37d9fece..9144c341 100644
--- a/editor/pamaddnoise.c
+++ b/editor/pamaddnoise.c
@@ -97,6 +97,8 @@ impulse_noise(sample   const maxval,
         *newSampleP = 0;
     else if ( sap >= high_tol )
         *newSampleP = maxval;
+    else
+        *newSampleP = origSample;
 }