Re: Mime type detection in beagle [Was: IndexHelper eating cpu]



> I've got the impression that the mime type detection with xgdmime depends
> too much on the file extensions instead of the files' contents. A plain
> "file" command or for images the "identify" utility from the ImageMagick
> package deliver by far more accurate results.

If you look at the rules for most of the types in current shared-mime-info, a 
lot of them are glob (extension pattern) based.
shared-mime-info.xml (FreeDesktop.Org spec) has the following to say "... 
There are several reasons for checking most of the glob patterns before the 
magic. Some applications don't check the magic at all, and this makes it more 
likely that both will get the same type. Users can easily understand why 
calling their text file <filename>README.mp3</filename> makes the system 
think it's an MP3, whereas they have trouble understanding why their computer 
thinks <filename>README.txt</filename> is a PostScript file. If the system 
guesses wrongly, the user can often rename the file to fix the problem...."

I sort of agree to what it says. The spec also claims that users can have a 
file Override.xml which will override the system settings.

> Would it be easily possible to use these external commands for mime type
> detection in beagle ? Lets say, like an external pre-filter before applying
> the real filter ?

All the major desktop environments are using/are moving to shared-mime-info 
and xdgmime. It would be pretty inconsistent if beagle indexes a file as jpeg 
but the user sees a pdf icon for that file in nautilus. It is much better to 
file bugs against shared-mime-info and get the problems fixed there.

> A bit funny: due to the current mime type detection I could identify quite
> a lot of wrongly named images and files in my $HOME and a large static
> index kind of "10 years Linux Magazine ..." as they caused an exception in
> beagled when they were run through the wrong filter ;).

You mean exception in index-helper :)
I would encourage users to keep watching for log files named like 
*-IndexHelperExceptions. Not necessarily to figure out incorrect filenames 
but more to report filter errors :-).

- dBera

-- 
-----------------------------------------------------
Debajyoti Bera @ http://dtecht.blogspot.com
beagle / KDE fan
Mandriva / Inspiron-1100 user



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]