After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 545133 - gnome-thumbnail should have a smarter way to handle mimetypes
gnome-thumbnail should have a smarter way to handle mimetypes
Status: RESOLVED DUPLICATE of bug 629231
Product: gnome-desktop
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks: 545130
 
 
Reported: 2008-07-28 11:52 UTC by Filippo Argiolas
Modified: 2012-06-22 10:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Filippo Argiolas 2008-07-28 11:52:04 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.
Comment 1 Bastien Nocera 2008-07-29 23:35:08 UTC
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?
Comment 2 André Klapper 2009-11-07 23:10:08 UTC
Thumbnailing has been moved from deprecated libgnomeui to gnome-desktop.
http://library.gnome.org/devel/gnome-desktop/stable/thumbnail.html
Comment 3 André Klapper 2010-03-27 19:38:02 UTC
(moving to gnome-desktop, no idea if still valid)
Comment 4 Bastien Nocera 2012-06-20 13:56:44 UTC
Flilippo, is this still a problem?
Comment 5 Filippo Argiolas 2012-06-22 09:59:33 UTC
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!
Comment 6 Bastien Nocera 2012-06-22 10:15:47 UTC
Indeed, that looks like a winner. Marking as a duplicate.

*** This bug has been marked as a duplicate of bug 629231 ***