Re: Suggestion for file type detection approach
- From: Rodney Dawes <dobey free fr>
- To: gardnerbiggs houston rr com
- Cc: Fabio Gomes <bugtraq gs2 com br>, nautilus-list gnome org, gnome-list gnome org, gnome-devel-list gnome org, gnome-vfs-list gnome org
- Subject: Re: Suggestion for file type detection approach
- Date: Fri, 26 Dec 2003 17:34:38 -0500
On Enj , 2003-12-25 at 14:14, gardnerbiggs houston rr com wrote:
> > On Thu, 2003-12-25 at 14:48 -0300, Fabio Gomes wrote:
> > However...
> >
> > > DETECTION BY SUFFIX
> > > 1.Allows wrong results on invalid input (files with wrong
> > > suffixes)
> >
> > Cannot be fixed to run correctly.
>
>
> Yes it can, the file suffix can be changed.
No. That's fixing the symptoms, not the problems. If I have an mp3 file,
and I rename it to audiofile.jpg, it should show image/jpeg as the MIME
type. This is correct. It is also wrong. The 1) is just explained wrong.
It should be 1) Gives correct (invalid) results on valid (incorrect)
input. Invalid input would be a filename without an extension, which
pretty much every installed executable script/binary doesn't have. I am
guessing the result for suffix-based mime type detection on such a file
would be application/octect-stream. This is obviously incorrect. Having
to have the user rename their files so that they get opened with the
right application, is inappropriate.
> There is nothing more frustrating than opening a dir of mp3's in nautilus and have it take over 2 min to display the files. While in windows it takes the blink of an eye.
Don't try to thumbnail them. My guess is that you installed Totem, which
sets up a thumbnailer for audio files. Not very appropriate. I would
suggest you go into gconf editor in the /desktop/gnome/thumbnailers tree
and disable the thumbnailing of the various audio types.
> I am all for nautilus using the extension when available and sniffing when appropriate (a file missing a suffix or when requested by the user)
Sniffing is always appropriate. Content type should be determined by
content, not by name. That is the reason it is Content Type and not
Name Type. Detecting by content is not that slow. In the cases where
it is slow, it should be optimized better.
> just my .02
And mine. :)
> >
> > Which is more common
> > a) Files which are badly named?
> > b) Files which are funny and nautilus sniffs the wrong thing?
>
>
> c) Nautilus bringing a system to its knees every time a dir with a large amount of files is opened?
The only reason I've ever had Nautilus >= 2.2 ever totally bring down my
system, was because of the thumbnailing. And, I doubt it was entirely
because of Nautilus. My machine only really locks up if I open the
built-in Compact Flash slot and then open that directory in a Nautilus
window. I am guessing the kernel I have running isn't so great with the
slot. It's certainly not all that great with a lot of things. If I get
the time to upgrade to 2.4.23 or something similar, I am guessing some
of these issues will go away. However, if you care to prove me wrong,
disable thumbnailing entirely in Nautilus, and open up a directory with
a lot of images or such, and you'll see it's much faster and doesn't
end up using all the CPU.
-- dobey
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]