After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 304238 - Check subclass of the extesions for when mime sniffing resulted in a text file
Check subclass of the extesions for when mime sniffing resulted in a text file
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: MIME data
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2005-05-15 09:32 UTC by kimiko
Modified: 2005-06-14 12:12 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10



Description kimiko 2005-05-15 09:32:54 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.
Comment 1 Sebastien Bacher 2005-05-15 10:15:08 UTC
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
Comment 2 kimiko 2005-05-15 10:24:25 UTC
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.
Comment 3 Sebastien Bacher 2005-05-15 10:36:49 UTC
correctly recognizes by what? nautilus?
Comment 4 kimiko 2005-05-15 10:41:18 UTC
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.
Comment 5 Olav Vitters 2005-05-15 10:42:26 UTC
https://bugs.freedesktop.org/show_bug.cgi?id=2788
Comment 6 kimiko 2005-05-15 10:51:34 UTC
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.
Comment 7 Sebastien Bacher 2005-05-15 12:18:56 UTC
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.
Comment 8 Christian Neumair 2005-05-15 12:25:13 UTC
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.
Comment 9 kimiko 2005-05-15 12:34:05 UTC
libgnomevfs2-0, libgnomevfs2-common: 2.10.1cvs20050510-0ubuntu2
nautilus: 2.10.1-1ubuntu1
Comment 10 kimiko 2005-05-15 12:41:08 UTC
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.
Comment 11 Christian Kellner 2005-05-15 14:56:31 UTC
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 :)
Comment 12 Christian Kellner 2005-05-30 10:01:44 UTC
This should be fixed on cvs head. Do I get some beer form you today on the
Novell Party Sebastien? :)
Comment 13 Sebastien Bacher 2005-06-08 11:07:03 UTC
gnome-vfs 2.11.2 has still this bug, no beer for you :p
Comment 14 Sebastien Bacher 2005-06-14 12:12:09 UTC
works fine now, bug closed