[gimp] Bug 791519 - Unexpected selection from channel



commit 8994246be259d05c33942a5c908c0907f96e0c5b
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 8 20:26:32 2018 +0200

    Bug 791519 - Unexpected selection from channel
    
    One additional fix for the gimp-channel-combine-masks procedure,
    it needs both the combined *and* combined-to buffer in
    gimp_gegl_mask_combine_buffer() to be treated specially.

 app/gegl/gimp-gegl-mask-combine.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-mask-combine.c b/app/gegl/gimp-gegl-mask-combine.c
index f826208..9ab0494 100644
--- a/app/gegl/gimp-gegl-mask-combine.c
+++ b/app/gegl/gimp-gegl-mask-combine.c
@@ -377,6 +377,7 @@ gimp_gegl_mask_combine_buffer (GeglBuffer     *mask,
 {
   GeglBufferIterator *iter;
   GeglRectangle       rect;
+  const Babl         *mask_format;
   const Babl         *add_on_format;
   gint                x, y, w, h;
 
@@ -397,8 +398,17 @@ gimp_gegl_mask_combine_buffer (GeglBuffer     *mask,
   rect.width  = w;
   rect.height = h;
 
+  /*  See below: this additional hack is only needed for the
+   *  gimp-channel-combine-masks procedure, it's the only place that
+   *  allows to combine arbitrary channels with each other.
+   */
+  if (gimp_babl_format_get_linear (gegl_buffer_get_format (mask)))
+    mask_format = babl_format ("Y float");
+  else
+    mask_format = babl_format ("Y' float");
+
   iter = gegl_buffer_iterator_new (mask, &rect, 0,
-                                   babl_format ("Y float"),
+                                   mask_format,
                                    GEGL_ACCESS_READWRITE, GEGL_ABYSS_NONE);
 
   rect.x -= off_x;


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