GNOME Bugzilla – Bug 545133
gnome-thumbnail should have a smarter way to handle mimetypes
Last modified: 2012-06-22 10:15:47 UTC
As far as I can tell currently gnome_thumbnail_factory generates thumbnails only if there is a thumbnailer command for the exact given mimetype in /desktop/gnome/thumbnailers. It just converts the mimetype in the gconf property from aaa@bbb@ccc to aaa/bbb+ccc and compares it to the given mimetype. Since mimetypes are organized in a hierarchical way we should fallback to the parent mimetype thumbnailer if we don't find the one for the given mimetype. Example: "video/ogg" doesn't have a registered thumbnailer but there is one for its parent class "application/ogg", so a thumbnail should be correctly generated.
Something like that might very well work. Index: gnome-thumbnail.c =================================================================== --- gnome-thumbnail.c (revision 5640) +++ gnome-thumbnail.c (working copy) @@ -136,7 +136,7 @@ } scripts_hash = g_hash_table_new_full (g_str_hash, - g_str_equal, + g_content_type_equals, g_free, g_free); If it doesn't work, I'd play with a function that calls g_content_type_equals() and g_content_type_is_a() on those 2 strings, and check what happens to the lookup when passing a "video/ogg" string to it. Does it do the lookup properly?
Thumbnailing has been moved from deprecated libgnomeui to gnome-desktop. http://library.gnome.org/devel/gnome-desktop/stable/thumbnail.html
(moving to gnome-desktop, no idea if still valid)
Flilippo, is this still a problem?
It's been a while since I've had any time to work on this but it looks like it should have been fixed by this commit: http://git.gnome.org/browse/gnome-desktop/commit/libgnome-desktop/gnome-desktop-thumbnail.c?id=4e066516b2e8d8c1b074af0aa69fa1733dadca44 Very little chance to run some test soon though, sorry!
Indeed, that looks like a winner. Marking as a duplicate. *** This bug has been marked as a duplicate of bug 629231 ***