Displayed file "Type" always follows file extension when it's a known extension (taking precedence over MIME type?)
Version information
Thunar 4.20.2
Xubuntu 25.04 daily build @ 2025-04-07
Steps to reproduce
- Take a screenshot via the Print Screen key (since Xfce defaults to outputting a PNG) and save the PNG somewhere
- Navigate to where the PNG is in Thunar and set Thunar to "List View"
- Rename the PNG to .flac
- Observe how Thunar now displays the file's "Type" as FLAC audio
- Do a right-click > Properties and notice that even the
Image
tab will be missing (it's still present when named without any extension)
Current behavior
Thunar treats the file extension as the absolute truth regardless of what the file actually contains.
This is particularly troublesome when dealing with the "modern" tendency of websites delivering WebP images with .jpg and .png file extensions - downloading such an image file has Thunar misidentify the WebP images as PNG or JPEG (which is how I discovered this issue).
Expected outcome
The file's internal contents, i.e. the MIME type, should be the absolute truth of what Thunar lists the "Type" as regardless of what the file extension is.
Additional information
Currently, if you remove the file extension altogether, Thunar does in fact display the file's "Type" correctly.
Also if you rename the extension to something that's not known i.e. random letters, the extension gets ignored and the file "Type" is still displayed correctly.