Prop: get attachment type from file contents



There were some comments in this list that balsa sometimes does not get a
"good" guess for the mime type on an attached file. I think the reason is that
we use gnome_mime_type_or_default() which just tries to get the type by
looking at the file name. I attach a patch which uses
gnome_mime_type_or_default_of_file() instead. This method "tries to determine
the mime-type of the filename by trying to guess the content of the file". It
will be somewhat slower as it is now necessary to do disk io instead of pure
memory operations, though.

Any comments?

Yours, Albrecht.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Albrecht Dreß  -  Monschauer Straße 22  -  D-53121 Bonn (Germany)
      Phone (+49) 228 6199571  -  E-Mail albrecht.dress@arcormail.de
_________________________________________________________________________

balsa-mime-type-patch.gz



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