diff options
author | Victor Kareh <[email protected]> | 2025-07-24 09:26:33 -0400 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2025-07-24 09:27:45 -0400 |
commit | f1275445e638d3c38c93457227602b7314f59d86 (patch) | |
tree | 431aca91c64e795b17ee9e1cac76a6ed2887569b /src/eom-jobs.c | |
parent | 1dcda49f5ca719dfea822a34ac7925246875240f (diff) | |
download | eom-fast-content-type.tar.bz2 eom-fast-content-type.tar.xz |
Eom*: Use fast content type as fallbackfast-content-type
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
Diffstat (limited to 'src/eom-jobs.c')
-rw-r--r-- | src/eom-jobs.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/eom-jobs.c b/src/eom-jobs.c index 7104268..0b51800 100644 --- a/src/eom-jobs.c +++ b/src/eom-jobs.c @@ -30,6 +30,7 @@ #include "eom-list-store.h" #include "eom-thumbnail.h" #include "eom-pixbuf-util.h" +#include "eom-util.h" #include <gdk-pixbuf/gdk-pixbuf.h> @@ -385,7 +386,9 @@ filter_files (GSList *files, GList **file_list, GList **error_list) if (file != NULL) { file_info = g_file_query_info (file, - G_FILE_ATTRIBUTE_STANDARD_TYPE","G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, + G_FILE_ATTRIBUTE_STANDARD_TYPE"," + G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE"," + G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, 0, NULL, NULL); if (file_info == NULL) { type = G_FILE_TYPE_UNKNOWN; @@ -397,7 +400,7 @@ filter_files (GSList *files, GList **file_list, GList **error_list) if (G_UNLIKELY (type == G_FILE_TYPE_UNKNOWN)) { const gchar *ctype; - ctype = g_file_info_get_content_type (file_info); + ctype = eom_util_get_content_type_with_fallback (file_info); /* If the content type is supported adjust the file_type */ |