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 342818 - Slow mime type detection is broken
Slow mime type detection is broken
Status: RESOLVED DUPLICATE of bug 339374
Product: gnome-vfs
Classification: Deprecated
Component: MIME and file/program mapping
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks: 336448
 
 
Reported: 2006-05-24 16:07 UTC by Nickolay V. Shmyrev
Modified: 2006-05-25 08:58 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14



Description Nickolay V. Shmyrev 2006-05-24 16:07:47 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
Comment 1 Nickolay V. Shmyrev 2006-05-25 05:08:04 UTC
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?
Comment 2 Nickolay V. Shmyrev 2006-05-25 05:59:49 UTC
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.


Comment 3 Nickolay V. Shmyrev 2006-05-25 06:05:29 UTC
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.
Comment 4 Sebastien Bacher 2006-05-25 08:58:45 UTC
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 ***