[gimp] app: use the new function in gimp_buffer_new_from_pixbuf()



commit a159740498b136ed99a66000dc97bc90ea1ca142
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jun 16 23:44:49 2015 +0200

    app: use the new function in gimp_buffer_new_from_pixbuf()

 app/core/gimpbuffer.c |   20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)
---
diff --git a/app/core/gimpbuffer.c b/app/core/gimpbuffer.c
index 181e90d..59c60e5 100644
--- a/app/core/gimpbuffer.c
+++ b/app/core/gimpbuffer.c
@@ -271,7 +271,8 @@ gimp_buffer_new_from_pixbuf (GdkPixbuf   *pixbuf,
 {
   GimpBuffer *gimp_buffer;
   GeglBuffer *buffer;
-  gchar      *icc_base64 = NULL;
+  guint8     *icc_data;
+  gsize       icc_len;
 
   g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
   g_return_val_if_fail (name != NULL, NULL);
@@ -281,21 +282,12 @@ gimp_buffer_new_from_pixbuf (GdkPixbuf   *pixbuf,
   gimp_buffer = gimp_buffer_new (buffer, name,
                                  offset_x, offset_y, FALSE);
 
-  g_object_get (pixbuf, "icc-profile", icc_base64, NULL);
+  icc_data = gimp_pixbuf_get_icc_profile (pixbuf, &icc_len);
 
-  if (icc_base64)
+  if (icc_data)
     {
-      guint8 *icc_data;
-      gsize   icc_len;
-
-      icc_data = g_base64_decode (icc_base64, &icc_len);
-      g_free (icc_base64);
-
-      if (icc_data)
-        {
-          gimp_buffer_set_icc_profile (gimp_buffer, icc_data, icc_len);
-          g_free (icc_data);
-        }
+      gimp_buffer_set_icc_profile (gimp_buffer, icc_data, icc_len);
+      g_free (icc_data);
     }
 
   g_object_unref (buffer);


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