D20011: Be more precise with mimetype detection
Alexander Stippich
noreply at phabricator.kde.org
Sun Mar 24 10:48:28 GMT 2019
astippich created this revision.
astippich added reviewers: Baloo, bruns.
Herald added projects: Frameworks, Baloo.
Herald added a subscriber: kde-frameworks-devel.
astippich requested review of this revision.
REVISION SUMMARY
D18819 <https://phabricator.kde.org/D18819> changed the mimetype detection to content matching. However,
this has side effects as the content matching algorithm quite often
puts out ancestor mimetypes, in some case even "application/octet-stream".
To solve this, query both extension and content mimetypes, and only
use the file extension mimetype when the mimetype detected by file content
is an ancestor, and use content mimetype when it isn't.
This gives the precise mime type as before the change, but also prevents
false detection only based on extension, which D18819 <https://phabricator.kde.org/D18819> tried to fix.
TEST PLAN
unfortunately, no unit tests
REPOSITORY
R293 Baloo
BRANCH
master
REVISION DETAIL
https://phabricator.kde.org/D20011
AFFECTED FILES
src/file/extractor/app.cpp
To: astippich, #baloo, bruns
Cc: kde-frameworks-devel, gennad, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190324/db3670fb/attachment.html>
More information about the Kde-frameworks-devel
mailing list