From c9af6ea8d3e8fc9c6fbeb2c7ed6fb0bb513eebef Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 9 Jan 2008 13:47:52 +0000 Subject: [PATCH] fix alpha handling on greyscale images. 2008-01-09 Michael Natterer * app/tools/gimplevelstool.c (gimp_levels_tool_map): fix alpha handling on greyscale images. svn path=/trunk/; revision=24577 --- ChangeLog | 5 +++++ app/tools/gimplevelstool.c | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 72324badcb..fda5540f93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-09 Michael Natterer + + * app/tools/gimplevelstool.c (gimp_levels_tool_map): fix alpha + handling on greyscale images. + 2008-01-09 Sven Neumann * plug-ins/common/convmatrix.c (convolve_image): round the result diff --git a/app/tools/gimplevelstool.c b/app/tools/gimplevelstool.c index 18010c313a..de71e22e78 100644 --- a/app/tools/gimplevelstool.c +++ b/app/tools/gimplevelstool.c @@ -280,9 +280,15 @@ gimp_levels_tool_map (GimpImageMapTool *image_map_tool) channel <= GIMP_HISTOGRAM_ALPHA; channel++) { - gegl_node_set (image_map_tool->operation, - "channel", channel, - NULL); + /* FIXME: hack */ + if (! tool->color && channel == 1) + gegl_node_set (image_map_tool->operation, + "channel", GIMP_HISTOGRAM_ALPHA, + NULL); + else + gegl_node_set (image_map_tool->operation, + "channel", channel, + NULL); gegl_node_set (image_map_tool->operation, "gamma", levels->gamma[channel], @@ -291,6 +297,10 @@ gimp_levels_tool_map (GimpImageMapTool *image_map_tool) "low-output", levels->low_output[channel] / 255.0, "high-output", levels->high_output[channel] / 255.0, NULL); + + /* FIXME: hack */ + if (! tool->color && channel == 1) + break; } }