[balsa/gtk3] More careful pixbuf loading



commit b417a9dff26d6d5fd31b2d73f93886cb3b373d34
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Aug 28 22:25:17 2011 -0400

    More careful pixbuf loading
    
    	* libbalsa/body.c (libbalsa_message_body_get_pixbuf): check for
    	error before closing loader.
    	* src/balsa-print-object-image.c (balsa_print_object_image): use
    	g_message instead of g_warning for image format error.

 ChangeLog                      |    7 +++++++
 libbalsa/body.c                |    2 +-
 src/balsa-print-object-image.c |    2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 70e91b8..67c7d8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-08-28  Peter Bloomfield
+
+	* libbalsa/body.c (libbalsa_message_body_get_pixbuf): check for
+	error before closing loader.
+	* src/balsa-print-object-image.c (balsa_print_object_image): use
+	g_message instead of g_warning for image format error.
+
 2011-08-26  Peter Bloomfield
 
 	Make BalsaMimeWidgetImage a subclass of BalsaMimeWidget
diff --git a/libbalsa/body.c b/libbalsa/body.c
index ada52bf..9dd05de 100644
--- a/libbalsa/body.c
+++ b/libbalsa/body.c
@@ -664,7 +664,7 @@ libbalsa_message_body_get_pixbuf(LibBalsaMessageBody * body, GError ** err)
             if (!gdk_pixbuf_loader_write(loader, (guchar *) buf, count, err))
                 break;
 
-        if (gdk_pixbuf_loader_close(loader, *err ? NULL : err))
+        if (!*err && gdk_pixbuf_loader_close(loader, err))
             pixbuf = g_object_ref(gdk_pixbuf_loader_get_pixbuf(loader));
 
         g_object_unref(loader);
diff --git a/src/balsa-print-object-image.c b/src/balsa-print-object-image.c
index f527310..23a4f02 100644
--- a/src/balsa-print-object-image.c
+++ b/src/balsa-print-object-image.c
@@ -117,7 +117,7 @@ balsa_print_object_image(GList * list, GtkPrintContext *context,
     /* check if we can handle the image */
     pixbuf = libbalsa_message_body_get_pixbuf(body, &err);
     if (err) {
-	g_warning("Error loading image from file: %s", err->message);
+	g_message("Error loading image from file: %s", err->message);
 	g_error_free(err);
     }
 



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