Bug 135873 - [Wish] An option to get MIME type from file extension before guessing it for file contents
Summary: [Wish] An option to get MIME type from file extension before guessing it for ...
Status: RESOLVED WORKSFORME
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-18 11:18 UTC by gambas
Modified: 2008-03-04 17:23 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gambas 2006-10-18 11:18:19 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

For example, Konqueror often detects bad MIME types from text files: A C header is detected as Objective-C header, a binary file is detected as HTML file because there is the "<html>" string somewhere at the beginning of the file...

We could have an option to make MIME type detection use the following algorithm:
- Use the file extension.
- If the file extension is not associated with anything, then don't try to guess the MIME type.
- If there is no file extension, try to guess the MIME type.
Comment 1 David Faure 2008-03-04 17:23:27 UTC
Yes, "guessing" ("mime magic") is unreliable, but it's still very useful in many cases. The solution is not to disable guessing, but to
1) improve the guessing
2) use extensions where guessing can't do it right

After updating to KDE4 (the mime implementation is completely different, it's now based on freedesktop.org shared-mime-info), please report any wrong "mimetype guessing" with example files.