GNOME Bugzilla – Bug 304238
Check subclass of the extesions for when mime sniffing resulted in a text file
Last modified: 2005-06-14 12:12:09 UTC
Distribution/Version: Ubuntu Breezy 1. take a random file with a known type (Nautilus shows a corresponding icon instead of the generic file icon) 2. rename the file so that it has the extension of another known type 3. Nautilus changes the icon to correspond to the new extension, even though the file itself (its contents) haven't changed 4. Bad Nautilus, bad! It should use content to determine file type, not extension. This is one of the most annoying things about Wind*ws's browser. I would expect a Gnome browser to do better, much better. Just invoking 'file' would almost completely solve the problem quickly.
click on the file and you get the correct icon. Nautilus uses the filename when you open a directory for performance reasons and use the file content when you select a file. I'm closing as NOTABUG
No it doesn't. I have a file here named 'quote.dat'. file(1) correctly recognizes it as "UTF-8 Unicode English text". Nautilus shows a video/mpeg icon and MIME type. This doesn't change when I click or double-click the file. It even tries to pass it to Totem, which of course doesn't know what to do with it. Nautilus doesn't allow me to change the file's MIME type, except by changing the extension.
correctly recognizes by what? nautilus?
file: /home/kimiko >file texts/quote.dat texts/quote.dat: UTF-8 Unicode English text Which is correct (quote.dat is a plain English text file). Nautilus incorrectly shows it as video/mpeg, and doesn't allow me to change this.
https://bugs.freedesktop.org/show_bug.cgi?id=2788
That FDO bug is somewhat related, but not the bug I'm reporting here. For example, a file 'miscquotes.txt' is recognized by Nautilus as MIME type text/plain. Renaming it to 'miscquotes.avi' changes its MIME type to video/x-msvideo. Nautilus tries to pass it to Totem when it is double-clicked, which of course doesn't work. I'm arguing that Nautilus should check a file's contents before assigning it a MIME type, or do so before opening it, or allow the user to manually correct its MIME type.
Nautilus does check the content before opening a file. What you are describing is specific to text files and is a change to gnomevfs between 2.10 and the current version. I'm reassigning to gnomevfs.
It would be very important to know what the gnome-vfs version you use is, i.e. when it was packaged. There have been recent changes to gnome-vfs wrt MIME type determination.
libgnomevfs2-0, libgnomevfs2-common: 2.10.1cvs20050510-0ubuntu2 nautilus: 2.10.1-1ubuntu1
Ah, you're right about this bug being specific to text files. I just tried the renaming trick with audio/midi and video/x-msvideo files, and the correct icons appear again when they are selected.
I think I know the place where this happens. I might come up with a patch soon. I also renamed the bug (nobody understands that prolly but I do :)
This should be fixed on cvs head. Do I get some beer form you today on the Novell Party Sebastien? :)
gnome-vfs 2.11.2 has still this bug, no beer for you :p
works fine now, bug closed