[gimp/metadata-browser] app: ask the image for the RGB format in	gimp_selection_extract()
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gimp/metadata-browser] app: ask the image for the RGB format in	gimp_selection_extract()
- Date: Wed, 12 Sep 2012 23:51:36 +0000 (UTC)
commit 0c0ce608056b1851e20e8818d7eb42d9499c382c
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]