From 77ff19dd8394167cdc9765af20a62bdaed18e308 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 1 Oct 2008 12:29:46 +0000 Subject: ** Fix for bug #554418 2008-10-01 Milan Crha ** Fix for bug #554418 * e-util/e-util.h: (e_util_guess_mime_type): * e-util/e-util.c: (e_util_guess_mime_type): Guess mime_type based on the file content only when permitted by the caller, otherwise check based on the filename only, where it fallbacks if file content guess fails. * mail/em-utils.c: (em_utils_snoop_type): * mail/em-popup.c: (emp_standard_menu_factory): Guess mime_type based on the filename only. * composer/e-msg-composer.c: (handle_uri), (e_msg_composer_add_inline_image_from_file): Guess mime_type based on the file content, if failed, then on the filename. * widgets/misc/e-attachment.c: (attachment_guess_mime_type): Allow guessing mime_type based on the file content. * calendar/gui/dialogs/comp-editor.c: (set_attachment_list): * calendar/gui/e-cal-popup.c: (ecalp_standard_menu_factory): Allow/disallow guessing of the mime_type based on the file content. svn path=/trunk/; revision=36529 --- composer/ChangeLog | 8 ++++++++ composer/e-msg-composer.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'composer') diff --git a/composer/ChangeLog b/composer/ChangeLog index ee0dfa5eee..0e5a3dd328 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,11 @@ +2008-10-01 Milan Crha + + ** Part of fix for bug #554418 + + * e-msg-composer.c: (handle_uri), + (e_msg_composer_add_inline_image_from_file): Guess mime_type based + on the file content, if failed, then on the filename. + 2008-09-29 Sankar P License Changes diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 5f75b79fc4..6c3fada7f3 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -3968,7 +3968,7 @@ handle_uri (EMsgComposer *composer, return; if (!g_ascii_strcasecmp (url->protocol, "file")) { - type = e_util_guess_mime_type (uri + strlen ("file://")); + type = e_util_guess_mime_type (uri + strlen ("file://"), TRUE); if (!type) return; @@ -4200,7 +4200,7 @@ e_msg_composer_add_inline_image_from_file (EMsgComposer *composer, camel_data_wrapper_construct_from_stream (wrapper, stream); camel_object_unref (CAMEL_OBJECT (stream)); - mime_type = e_util_guess_mime_type (dec_file_name); + mime_type = e_util_guess_mime_type (dec_file_name, TRUE); if (mime_type == NULL) mime_type = g_strdup ("application/octet-stream"); camel_data_wrapper_set_mime_type (wrapper, mime_type); -- cgit v1.2.3