[gimp] Bug 795048 - Image->mode->Grayscale results in a black or transparent image



commit 87a10aaf9e75a1b65d1630a7e2539186e4d67b78
Author: Ell <ell_se yahoo com>
Date:   Sat Apr 7 11:35:25 2018 -0400

    Bug 795048 - Image->mode->Grayscale results in a black or transparent image
    
    In gimp_gegl_convert_color_profile(), when src/dest_rect is NULL,
    use the extents of src/dest_buffer, instead of passing a NULL area
    to gimp_parallel_distribute_area(), which results in a CRITICAL.
    
    Additionally, only report progress on the main thread.

 app/gegl/gimp-gegl-loops.cc |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-loops.cc b/app/gegl/gimp-gegl-loops.cc
index b92bc40..d8f7503 100644
--- a/app/gegl/gimp-gegl-loops.cc
+++ b/app/gegl/gimp-gegl-loops.cc
@@ -837,6 +837,14 @@ gimp_gegl_index_to_mask (GeglBuffer          *indexed_buffer,
     });
 }
 
+static void
+gimp_gegl_convert_color_profile_progress (GimpProgress *progress,
+                                          gdouble       value)
+{
+  if (gegl_is_main_thread ())
+    gimp_progress_set_value (progress, value);
+}
+
 void
 gimp_gegl_convert_color_profile (GeglBuffer               *src_buffer,
                                  const GeglRectangle      *src_rect,
@@ -866,12 +874,21 @@ gimp_gegl_convert_color_profile (GeglBuffer               *src_buffer,
                                         intent,
                                         (GimpColorTransformFlags) flags);
 
+  if (! src_rect)
+    src_rect = gegl_buffer_get_extent (src_buffer);
+
+  if (! dest_rect)
+    dest_rect = gegl_buffer_get_extent (dest_buffer);
+
   if (transform)
     {
       if (progress)
-        g_signal_connect_swapped (transform, "progress",
-                                  G_CALLBACK (gimp_progress_set_value),
-                                  progress);
+        {
+          g_signal_connect_swapped (
+            transform, "progress",
+            G_CALLBACK (gimp_gegl_convert_color_profile_progress),
+            progress);
+        }
 
       GIMP_TIMER_START ();
 


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