[evolution-rss] fix displaying of images (regardles of resize setting) also fix rh bug #595745



commit 23f8fefef9c3124d62fd55e10b1763c4a14c1b11
Author: Lucian Langa <lucilanga gnome org>
Date:   Wed May 26 16:28:45 2010 +0300

    fix displaying of images (regardles of resize setting)
    also fix rh bug #595745

 src/rss-image.h |    1 +
 src/rss.c       |   71 ++++++++++++++++++++++++++----------------------------
 2 files changed, 35 insertions(+), 37 deletions(-)
---
diff --git a/src/rss-image.h b/src/rss-image.h
index dbc8e4f..204b6d3 100644
--- a/src/rss-image.h
+++ b/src/rss-image.h
@@ -26,6 +26,7 @@ typedef struct _FEED_IMAGE {
 
 void rss_load_images(void);
 gboolean display_folder_icon(GtkTreeStore *store, gchar *key);
+gchar *decode_image_cache_filename(gchar *name);
 void
 #if LIBSOUP_VERSION < 2003000
 finish_create_icon (SoupMessage *msg, FEED_IMAGE *user_data);
diff --git a/src/rss.c b/src/rss.c
index e2d73d7..ac3bfe6 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -2203,6 +2203,11 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHookTarget *t)	//camelmimepart
 
 		g_string_free(content, 1);
 	} else {
+		gchar *wids;
+		xmlDoc *src;
+		guint width;
+		GtkWidget *obj = (GtkWidget *)emfh->html;
+
 		d("normal html rendering\n");
 		buffer = g_byte_array_new ();
 		camel_stream_mem_set_byte_array (stream, buffer);
@@ -2226,38 +2231,31 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHookTarget *t)	//camelmimepart
 		} else
 			tmp = g_strdup((gchar *)(buffer->data));
 
-		if (gconf_client_get_bool (rss_gconf,
-					GCONF_KEY_IMAGE_RESIZE,
-					NULL)) {
-			gchar *wids;
-			xmlDoc *src;
-			guint width;
-
-			GtkWidget *obj = (GtkWidget *)emfh->html;
-			gtk_widget_get_allocation(obj, &alloc);
-			width = alloc.width - 56;
-			wids = g_strdup_printf("%d", width);
-			src = (xmlDoc *)parse_html_sux(
-					tmp,
-					strlen(tmp));
-			if (src) {
-				xmlNode *doc = (xmlNode *)src;
-				while ((doc = html_find(doc, (gchar *)"img"))) {
-					int real_width = 0;
-					xmlChar *url = xmlGetProp(
-							doc,
-							(xmlChar *)"src");
-					//FIXME: this should run even if image_resize is not on
-					gchar *real_image = verify_image(
-								(gchar *)url,
-								emfh);
-					if (real_image) {
-						xmlSetProp(
-							doc,
-							(xmlChar *)"src",
-							(xmlChar *)real_image);
-						g_free(real_image);
-					}
+		gtk_widget_get_allocation(obj, &alloc);
+		width = alloc.width - 56;
+		wids = g_strdup_printf("%d", width);
+		src = (xmlDoc *)parse_html_sux(
+				tmp,
+				strlen(tmp));
+		if (src) {
+			xmlNode *doc = (xmlNode *)src;
+			while ((doc = html_find(doc, (gchar *)"img"))) {
+				int real_width = 0;
+				xmlChar *url = xmlGetProp(
+						doc,
+						(xmlChar *)"src");
+				gchar *real_image = verify_image(
+							(gchar *)url,
+							emfh);
+				if (real_image) {
+					xmlSetProp(
+						doc,
+						(xmlChar *)"src",
+						(xmlChar *)real_image);
+					g_free(real_image);
+				}
+				if (gconf_client_get_bool (rss_gconf,
+					GCONF_KEY_IMAGE_RESIZE, NULL)) {
 					pix = gdk_pixbuf_new_from_file(
 						(const char *)url,
 						(GError **)NULL);
@@ -2287,12 +2285,11 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHookTarget *t)	//camelmimepart
 					}
 pixdone:			g_free(url);
 				}
-				xmlDocDumpMemory(src, &buff, (int*)&size);
-				xmlFree(src);
 			}
-			g_free(wids);
-		} else
-			buff=(xmlChar *)tmp;
+			xmlDocDumpMemory(src, &buff, (int*)&size);
+			xmlFree(src);
+		}
+		g_free(wids);
 
 		g_byte_array_free (buffer, 1);
 #if (DATASERVER_VERSION >= 2031001)



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