From f1275445e638d3c38c93457227602b7314f59d86 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Thu, 24 Jul 2025 09:26:33 -0400 Subject: Eom*: Use fast content type as fallback It turns out that, depending on the responsible GVfs implementation, a GFileInfo may not actually set the content type attribute even if requested. Since knowing the content type is rather critical for eom try to use the fast content type as a fallback in those cases. The fast content type should be hardly unknown as it is usually just based on the file extension. Fixes #360. Backported from https://gitlab.gnome.org/GNOME/eog/-/commit/de19faf73c8d8627193320d512c8b97316d9740c --- src/eom-thumb-view.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/eom-thumb-view.c') diff --git a/src/eom-thumb-view.c b/src/eom-thumb-view.c index 0b28440..332d180 100644 --- a/src/eom-thumb-view.c +++ b/src/eom-thumb-view.c @@ -27,6 +27,7 @@ #include "eom-list-store.h" #include "eom-image.h" #include "eom-job-queue.h" +#include "eom-util.h" #ifdef HAVE_EXIF #include "eom-exif-util.h" @@ -494,7 +495,8 @@ thumbview_get_tooltip_string (EomImage *image) file = eom_image_get_file (image); file_info = g_file_query_info (file, - G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, + G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE"," + G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, 0, NULL, NULL); g_object_unref (file); if (file_info == NULL) { @@ -502,7 +504,7 @@ thumbview_get_tooltip_string (EomImage *image) return NULL; } - mime_str = g_file_info_get_content_type (file_info); + mime_str = eom_util_get_content_type_with_fallback (file_info); if (G_UNLIKELY (mime_str == NULL)) { g_free (bytes); -- cgit v1.2.1