[evolution] Bug 732892 - Scale-down contact images in message preview



commit 968a7477c72124fc0f7af837b4894db6ee4553d2
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Jul 16 10:55:48 2014 +0200

    Bug 732892 - Scale-down contact images in message preview
    
    Set the maximal width and height of the contact image to 96 px. Also do
    the same in the contact preview in addressbook.

 addressbook/gui/widgets/eab-contact-formatter.c |    9 +++++----
 data/webview.css                                |    5 +++++
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/gui/widgets/eab-contact-formatter.c b/addressbook/gui/widgets/eab-contact-formatter.c
index 30b397d..6aa45c9 100644
--- a/addressbook/gui/widgets/eab-contact-formatter.c
+++ b/addressbook/gui/widgets/eab-contact-formatter.c
@@ -537,7 +537,8 @@ render_title_block (EABContactFormatter *formatter,
                                photo->data.inlined.data,
                                photo->data.inlined.length);
                g_string_append_printf (
-                       buffer, "<img border=\"1\" src=\"data:%s;base64,%s\">",
+                       buffer,
+                       "<img id=\"__evo-contact-photo\" border=\"1\" src=\"data:%s;base64,%s\">",
                        photo->data.inlined.mime_type,
                        photo_data);
        } else if (photo && photo->type == E_CONTACT_PHOTO_TYPE_URI && photo->data.uri && *photo->data.uri) {
@@ -549,7 +550,7 @@ render_title_block (EABContactFormatter *formatter,
                uri = unescaped;
                #endif
                g_string_append_printf (
-                       buffer, "<img border=\"1\" src=\"%s%s\">",
+                       buffer, "<img id=\"__evo-contact-photo\" border=\"1\" src=\"%s%s\">",
                        is_local ? "evo-" : "", uri);
                #if !(WEBKIT_MAJOR_VERSION == 2 && WEBKIT_MINOR_VERSION == 2)
                g_free (unescaped);
@@ -1068,7 +1069,7 @@ render_compact (EABContactFormatter *formatter,
                        #endif
                        g_string_append_printf (
                                buffer,
-                               "<img width=\"%d\" height=\"%d\" src=\"%s%s\">",
+                               "<img id=\"__evo-contact-photo\" width=\"%d\" height=\"%d\" src=\"%s%s\">",
                                calced_width, calced_height,
                                is_local ? "evo-" : "", uri);
                        #if !(WEBKIT_MAJOR_VERSION == 2 && WEBKIT_MINOR_VERSION == 2)
@@ -1082,7 +1083,7 @@ render_compact (EABContactFormatter *formatter,
                                        photo->data.inlined.length);
                        g_string_append_printf (
                                buffer,
-                               "<img border=\"1\" src=\"data:%s;base64,%s\" "
+                               "<img id=\"__evo-contact-photo\" border=\"1\" src=\"data:%s;base64,%s\" "
                                        "width=\"%d\" height=\"%d\">",
                                photo->data.inlined.mime_type,
                                photo_data,
diff --git a/data/webview.css b/data/webview.css
index 6a5eb1b..5c0877c 100644
--- a/data/webview.css
+++ b/data/webview.css
@@ -23,6 +23,11 @@ span.navigable, div.navigable, p.navigable {
   color: #003399;
 }
 
+img#__evo-contact-photo {
+  max-width: 96px;
+  max-height: 96px;
+}
+
 img.navigable {
   cursor: pointer;
   margin-right: 4px;


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