From 86aef68b580c08274ffe0b26f58b36f88b3220a5 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Tue, 8 Dec 2020 02:49:50 +0000 Subject: Fix garbage output with type -impulse git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3995 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- doc/HISTORY | 4 ++++ editor/pamaddnoise.c | 2 ++ 2 files changed, 6 insertions(+) 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; } -- cgit 1.4.1