[gimp/goat-invasion: 514/526] app: ask the image for the RGB format in gimp_selection_extract()



commit 6e652619b6aeb336309d7c7841739100e8c9ae57
Author: Michael Natterer <mitch gimp org>
Date:   Sat Apr 21 08:35:52 2012 +0200

    app: ask the image for the RGB format in gimp_selection_extract()
    
    instead of hardcoding it.

 app/core/gimpselection.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/app/core/gimpselection.c b/app/core/gimpselection.c
index f2647e2..c66d3a1 100644
--- a/app/core/gimpselection.c
+++ b/app/core/gimpselection.c
@@ -673,10 +673,9 @@ gimp_selection_extract (GimpSelection *selection,
   /*  How many bytes in the temp buffer?  */
   if (babl_format_is_palette (src_format) && ! keep_indexed)
     {
-      if (add_alpha || babl_format_has_alpha (src_format))
-        dest_format = babl_format ("R'G'B'A u8");
-      else
-        dest_format = babl_format ("R'G'B' u8");
+      dest_format = gimp_image_get_format (image, GIMP_RGB,
+                                           add_alpha ||
+                                           babl_format_has_alpha (src_format));
     }
   else
     {



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