aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-07-16 16:55:48 +0800
committerTomas Popela <tpopela@redhat.com>2014-07-16 16:56:56 +0800
commit968a7477c72124fc0f7af837b4894db6ee4553d2 (patch)
treef65c61ba0d735d2f686017905bbb3be799a2430c
parent65e07523570f20a4500bc7c1ff8acf7c4dd36a03 (diff)
downloadgsoc2013-evolution-968a7477c72124fc0f7af837b4894db6ee4553d2.tar
gsoc2013-evolution-968a7477c72124fc0f7af837b4894db6ee4553d2.tar.gz
gsoc2013-evolution-968a7477c72124fc0f7af837b4894db6ee4553d2.tar.bz2
gsoc2013-evolution-968a7477c72124fc0f7af837b4894db6ee4553d2.tar.lz
gsoc2013-evolution-968a7477c72124fc0f7af837b4894db6ee4553d2.tar.xz
gsoc2013-evolution-968a7477c72124fc0f7af837b4894db6ee4553d2.tar.zst
gsoc2013-evolution-968a7477c72124fc0f7af837b4894db6ee4553d2.zip
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.
-rw-r--r--addressbook/gui/widgets/eab-contact-formatter.c9
-rw-r--r--data/webview.css5
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 30b397d1c6..6aa45c966c 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 6a5eb1b00f..5c0877c916 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;