From 255e0529040baae67e3d70f1030ce248fd61856d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Wed, 27 Jun 2012 13:50:54 +0200 Subject: Fix displaying photos in contacts preview EContactPhoto URIs are already escaped, but WebKit escapes it again, so images are not displayed sometimes. Unescaping the URI before writing it to the HTML fixes to problem. --- addressbook/gui/widgets/eab-contact-formatter.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/widgets/eab-contact-formatter.c b/addressbook/gui/widgets/eab-contact-formatter.c index cc4988d5b3..43d68b163f 100644 --- a/addressbook/gui/widgets/eab-contact-formatter.c +++ b/addressbook/gui/widgets/eab-contact-formatter.c @@ -421,10 +421,11 @@ render_title_block (EABContactFormatter *formatter, photo_data); } else if (photo && photo->type == E_CONTACT_PHOTO_TYPE_URI && photo->data.uri && *photo->data.uri) { gboolean is_local = g_str_has_prefix (photo->data.uri, "file://"); - + gchar *unescaped = g_uri_unescape_string (photo->data.uri, NULL); g_string_append_printf ( buffer, "", - is_local ? "evo-" : "", photo->data.uri); + is_local ? "evo-" : "", unescaped); + g_free (unescaped); } if (photo) @@ -878,11 +879,13 @@ render_compact (EABContactFormatter *formatter, if (photo->type == E_CONTACT_PHOTO_TYPE_URI && photo->data.uri && *photo->data.uri) { gboolean is_local = g_str_has_prefix (photo->data.uri, "file://"); + gchar *unescaped = g_uri_unescape_string (photo->data.uri, NULL); g_string_append_printf ( buffer, "", calced_width, calced_height, - is_local ? "evo-" : "", photo->data.uri); + is_local ? "evo-" : "", unescaped); + g_free (unescaped); } else { gchar *photo_data; -- cgit v1.2.3