diff options
author | Victor Kareh <[email protected]> | 2025-07-24 09:26:33 -0400 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2025-08-05 18:42:54 +0000 |
commit | b250c98f1e607b29e74ca2a14a1980ba905e4146 (patch) | |
tree | 431aca91c64e795b17ee9e1cac76a6ed2887569b /src/eom-thumbnail.c | |
parent | 75d7f546d53f6bf50190e206c39c8eddd258d298 (diff) | |
download | eom-b250c98f1e607b29e74ca2a14a1980ba905e4146.tar.bz2 eom-b250c98f1e607b29e74ca2a14a1980ba905e4146.tar.xz |
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-thumbnail.c')
-rw-r--r-- | src/eom-thumbnail.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/eom-thumbnail.c b/src/eom-thumbnail.c index 6a278b3..30a5760 100644 --- a/src/eom-thumbnail.c +++ b/src/eom-thumbnail.c @@ -36,6 +36,7 @@ #include "eom-thumbnail.h" #include "eom-list-store.h" #include "eom-debug.h" +#include "eom-util.h" #define EOM_THUMB_ERROR eom_thumb_error_quark () @@ -161,6 +162,7 @@ eom_thumb_data_new (GFile *file, GError **error) file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," + G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE "," G_FILE_ATTRIBUTE_TIME_MODIFIED "," G_FILE_ATTRIBUTE_THUMBNAIL_PATH "," G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "," @@ -176,7 +178,7 @@ eom_thumb_data_new (GFile *file, GError **error) /* if available, copy data */ data->mtime = g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_TIME_MODIFIED); - data->mime_type = g_strdup (g_file_info_get_content_type (file_info)); + data->mime_type = g_strdup (eom_util_get_content_type_with_fallback (file_info)); data->thumb_exists = (g_file_info_get_attribute_byte_string (file_info, G_FILE_ATTRIBUTE_THUMBNAIL_PATH) != NULL); |