[gimp/gimp-2-10] app: fix gimp_operation_levels_map_input() for negative values



commit f141fc4064a92a34dc11b97b8c5b1442e00313ad
Author: Ell <ell_se yahoo com>
Date:   Fri Apr 19 05:42:09 2019 -0400

    app: fix gimp_operation_levels_map_input() for negative values
    
    ... when gamma != 1
    
    (cherry picked from commit dc6ca2cf9a99d652fdda40d11b916eb725dd9ec4)

 app/operations/gimpoperationlevels.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/app/operations/gimpoperationlevels.c b/app/operations/gimpoperationlevels.c
index ea91a48631..1bf0b0636b 100644
--- a/app/operations/gimpoperationlevels.c
+++ b/app/operations/gimpoperationlevels.c
@@ -201,7 +201,7 @@ gimp_operation_levels_map_input (GimpLevelsConfig     *config,
   else
     value = (value - config->low_input[channel]);
 
-  if (config->gamma[channel] != 0.0)
+  if (config->gamma[channel] != 0.0 && value > 0.0)
     value = pow (value, 1.0 / config->gamma[channel]);
 
   return value;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]