SUMMARY kmimetypefinder5 misidentifies text files as image/x-quicktime if they match 'head -n 1 | grep '^....idat'. STEPS TO REPRODUCE 1. Create a file called readme.txt that contains only the word "candidate". 2. Run "kmimetypefinder5 readme.txt" OBSERVED RESULT image/x-quicktime EXPECTED RESULT text/plain SOFTWARE/OS VERSIONS KDE Plasma Version: 5.12.9 KDE Frameworks Version: 5.44.0 Qt Version: 5.9.5 Kernel Version: 5.3.0-59-generic ADDITIONAL INFORMATION This is due to the magic value of qtif files: <magic priority="50"> <match value="idat" type="string" offset="4"/> </magic> <glob pattern="*.qtif"/> <glob pattern="*.qif"/> /usr/share/mime/packages/freedesktop.org.xml It could be helped by a more robust match value, but it should also not be matched by files that do not match the glob pattern. $ kmimetypefinder5 --version kmimetypefinder 5.12.8
Created attachment 129536 [details] File that replicates the bug. Contains just the string "candidate".
Please report this to XDG mime database maintainers.
OK, but why is kmimetypefinder matching image/x-quicktime to files that end in .txt, not .qtif or .qif?