From 473aa90a140013d008c7cc7c708d80adf8316781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Tschumperl=C3=A9?= Date: Mon, 4 Jun 2018 20:59:26 +0200 Subject: [PATCH] . --- src/main/cpp/CImg.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/cpp/CImg.h b/src/main/cpp/CImg.h index 8091509..0f78810 100644 --- a/src/main/cpp/CImg.h +++ b/src/main/cpp/CImg.h @@ -27483,7 +27483,10 @@ namespace cimg_library_suffixed { } break; case 2 : { // Salt & Pepper noise if (nsigma<0) nsigma = -nsigma; - if (M==m) { m = 0; M = cimg::type::is_float()?(Tfloat)1:(Tfloat)cimg::type::max(); } + if (M==m) { + if (cimg::type::is_float()) { m = (Tfloat)0; M = (Tfloat)1; } + else { m = (Tfloat)cimg::type::min(); M = (Tfloat)cimg::type::max(); } + } cimg_rof(*this,ptrd,T) if (cimg::rand(100)