GNOME Bugzilla – Bug 342818
Slow mime type detection is broken
Last modified: 2006-05-25 08:58:45 UTC
1. Rename pdf or tar.gz file to file.html 2. Run gnomevfs-info -s file.html Name : file.html Type : Regular MIME type : text/html Default app : redhat-web.desktop Size : 1923715 Blocks : 3768 I/O block size : 4096 Local : YES SUID : NO SGID : NO Sticky : NO Permissions : 1600755 Link count : 1 UID : 500 GID : 500 Access time : Wed May 24 20:12:22 2006 Modification time : Sun Jan 22 20:41:24 2006 Change time : Wed May 24 20:12:11 2006 Device # : 769 Inode # : 8056336 Readable : YES Writable : YES Executable : YES
This bug was caused by the following change: 2006-02-27 Christian Neumair <chris@gnome-de.org> * src/xdgmimemagic.c: (_xdg_mime_magic_lookup_data): Make priority equality check more robust so that it works for three or more matches. Also allow matchlets with 0 priority Commenting the code fixes the problem: #if 0 else if (had_match && match->priority == priority) /* multiple unrelated patterns with the same priority matched, * so we can't tell what type this is. */ mime_type = NULL; #endif Christian, do you have any good reason for this change?
Ok, this problem is caused by matlab mime pattern '%' which should have lower priority then %PDF-. Probably this may be reassigned to shared-mime-info. tar.gz is a separtate thing, this case is handled differently in gnome-vfs when extension has bigger priority than contents. I think this could be also changed. Also, it would be nice to get warning in the case of mime types with the same priority or return an error as gnome-vfs result. It's just hard to find the reason of silent fallback.
Ups, sorry for spam, the problem with matlab was fixed in shared-mime-info. But it would be probably nice to have warning and correct handling of gzipped data.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 339374 ***