Bug 153672

Summary: kmimetypefinder doesn't report pdfs with non-pdf extension as application/pdf
Product: [Frameworks and Libraries] kdelibs Reporter: Armin Berres <armin>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: felix
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Armin Berres 2007-12-08 12:25:26 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

It seems as if kde uses the extension of a file to determine it's mime type.
When you have a pdf which is called foo.cgi e.g. (in my case created on the fly by a broken webpage) kmimetypefinder reports this as 
| application/x-cgi
| (accuracy 100)
If I use 'file' I get the following:
| PDF document, version 1.4
Because of the wrong mime type the pdf can't be opened by okular.
The interesting thing: pdfs with a non-standard extension (.fweeg or whatever) are correctly classified as pdf.

How to reproduce:
Take a pdf file with .pdf extension, run kmimetypefinder on it -> application/pdf is reported
Change the extension to .cgi, run kmimetypefinder on it -> application/x-cgi is reported
The same happens with .txt or .wav, or...
Comment 1 David Faure 2007-12-17 13:51:47 UTC
Indeed, thanks for the report.
Filed upstream as https://bugs.freedesktop.org/show_bug.cgi?id=13700
Comment 2 Felix Möller 2008-09-27 11:06:24 UTC
This is fixed upstream please close: https://bugs.freedesktop.org/show_bug.cgi?id=13700#c4
Comment 3 Urs Wolfer 2008-09-27 11:13:01 UTC
Fixed upstream.