[easytag/wip/future-gtk: 40/42] Use gdk_pixbuf_loader_write_bytes()



commit 87012730c6ce9aaf7e2d011d8de44a47a03a8131
Author: David King <amigadave amigadave com>
Date:   Fri Jan 9 20:33:08 2015 +0000

    Use gdk_pixbuf_loader_write_bytes()
    
    Added in GDK Pixbuf 2.30.

 src/tag_area.c     |    8 +-------
 src/tags/ogg_tag.c |    9 ++-------
 2 files changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/src/tag_area.c b/src/tag_area.c
index 2ce23c0..9cfaa56 100644
--- a/src/tag_area.c
+++ b/src/tag_area.c
@@ -1242,13 +1242,7 @@ PictureEntry_Update (EtTagArea *self,
 
     if (loader)
     {
-        gconstpointer data;
-        gsize data_size;
-
-        data = g_bytes_get_data (pic->bytes, &data_size);
-
-        /* TODO: Use gdk_pixbuf_loader_write_bytes(). */
-        if (gdk_pixbuf_loader_write (loader, data, data_size, &error))
+        if (gdk_pixbuf_loader_write_bytes (loader, pic->bytes, &error))
         {
             GtkTreeSelection *selection;
             GdkPixbuf *pixbuf;
diff --git a/src/tags/ogg_tag.c b/src/tags/ogg_tag.c
index 159c5b2..74e48c1 100644
--- a/src/tags/ogg_tag.c
+++ b/src/tags/ogg_tag.c
@@ -1004,17 +1004,12 @@ ogg_tag_write_file_tag (const ET_File *ETFile,
         if (format != PICTURE_FORMAT_PNG && format != PICTURE_FORMAT_JPEG)
         {
             GdkPixbufLoader *loader;
-            gconstpointer old_data;
-            gsize old_data_size;
             GError *loader_error = NULL;
 
             loader = gdk_pixbuf_loader_new ();
 
-            old_data = g_bytes_get_data (pic->bytes, &old_data_size);
-
-            /* TODO: Use gdk_pixbuf_loader_write_bytes() */
-            if (!gdk_pixbuf_loader_write (loader, old_data, old_data_size,
-                                          &loader_error))
+            if (!gdk_pixbuf_loader_write_bytes (loader, pic->bytes,
+                                                &loader_error))
             {
                 g_debug ("Error parsing image data: %s",
                          loader_error->message);


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