diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-05-17 01:06:56 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-05-20 01:07:20 +0800 |
commit | cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9 (patch) | |
tree | 271b673b6e311d5cb44acdd0b6c1d1830aa6982e /em-format/e-mail-formatter-image.c | |
parent | f6f11a1da2dfa2c7616cd18b36a44fefd66f0c75 (diff) | |
download | gsoc2013-evolution-cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9.tar.gz gsoc2013-evolution-cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9.tar.zst gsoc2013-evolution-cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9.zip |
em-format cleanups.
Diffstat (limited to 'em-format/e-mail-formatter-image.c')
-rw-r--r-- | em-format/e-mail-formatter-image.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/em-format/e-mail-formatter-image.c b/em-format/e-mail-formatter-image.c index 82c635827a..f69a59cdba 100644 --- a/em-format/e-mail-formatter-image.c +++ b/em-format/e-mail-formatter-image.c @@ -104,8 +104,8 @@ emfe_image_format (EMailFormatterExtension *extension, } } else { - gchar *buffer; + const gchar *mime_type; if (!e_mail_formatter_get_animate_images (formatter)) { @@ -121,11 +121,16 @@ emfe_image_format (EMailFormatterExtension *extension, content = g_base64_encode ((guchar *) ba->data, ba->len); } + mime_type = part->mime_type; + if (mime_type == NULL) + mime_type = "image/*"; + /* The image is already base64-encrypted so we can directly * paste it to the output */ buffer = g_strdup_printf ( - "<img src=\"data:%s;base64,%s\" style=\"max-width: 100%%;\" />", - part->mime_type ? part->mime_type : "image/*", content); + "<img src=\"data:%s;base64,%s\" " + " style=\"max-width: 100%%;\" />", + mime_type, content); camel_stream_write_string (stream, buffer, cancellable, NULL); g_free (buffer); |