[gimp] Fix variable used uninitialized warnings. Set upper bound to the size of the image, though the size_



commit df6034884afcffee6bc7f62addc6b81d2ec60a46
Author: Akkana Peck <akkana git gnome org>
Date:   Sat Jul 30 21:17:16 2016 -0600

    Fix variable used uninitialized warnings.
    Set upper bound to the size of the image, though the size_entry
    seems to ignore upper and lower bounds anyway.

 plug-ins/common/border-average.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/common/border-average.c b/plug-ins/common/border-average.c
index 412c5fe..81b3a58 100644
--- a/plug-ins/common/border-average.c
+++ b/plug-ins/common/border-average.c
@@ -348,7 +348,7 @@ borderaverage_dialog (gint32        image_ID,
   GtkSizeGroup *group;
   gboolean      run;
   gdouble       xres, yres;
-  gint          width, height;
+  GeglBuffer   *buffer = NULL;
 
   const gchar *labels[] =
     { "1", "2", "4", "8", "16", "32", "64", "128", "256" };
@@ -406,8 +406,11 @@ borderaverage_dialog (gint32        image_ID,
   gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_entry), 0, xres, TRUE);
 
   /*  set the size (in pixels) that will be treated as 0% and 100%  */
-  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (size_entry), 0, 0.0,
-                            MIN (width, height));
+  buffer = gimp_drawable_get_buffer (drawable_id);
+  if (buffer)
+      gimp_size_entry_set_size (GIMP_SIZE_ENTRY (size_entry), 0, 0.0,
+                                MIN (gegl_buffer_get_width(buffer),
+                                     gegl_buffer_get_height(buffer)));
 
   gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (size_entry), 0,
                                          1.0, 256.0);


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