Skip to content

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

  1. Take a screenshot via the Print Screen key (since Xfce defaults to outputting a PNG) and save the PNG somewhere
  2. Navigate to where the PNG is in Thunar and set Thunar to "List View"
  3. Rename the PNG to .flac
  4. Observe how Thunar now displays the file's "Type" as FLAC audio
  5. 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.

Demonstration video

video

Edited by NM64