[Thunar-dev] Proper way to determine the type of a file more accurate than thunar_file_get_content_type()

Nick Schermer nickschermer at gmail.com
Wed May 11 09:33:14 CEST 2011


What is libgmagic, google return almost no hits... I personally think
this is a bit overkill to fix a bug (which also makes it impossible
the apply the fix in 4.8 as well).

The patch to check the exact content type you attached on the bug
seems reasonable, I'll take a look at this.

Nick

On Wed, May 11, 2011 at 12:02 AM, Hubert Hesse <xfce at hubertscorner.de> wrote:
> Hi list,
>
> sorry to bother you again. Can you give me an answer to my question
> whether I can introduce libgmagic to determine the types of files
> directly? Or is there a better way to this?
>
> kind regards,
> Hubert Hese
>
>
>
> -------- Original Message --------
> Subject: [Thunar-dev] Proper way to determine the type of a file more
> accurate than thunar_file_get_content_type()
> Date: Fri, 29 Apr 2011 00:04:19 +0200
> From: Hubert Hesse <xfce at hubertscorner.de>
> Reply-To: xfce file manager <thunar-dev at xfce.org>
> To: Thunar-dev at xfce.org
>
> Hi,
>
> I am working on #2913 "Svg files cause thunar window to freeze".
>
> The problem resulted from a gdk function gdk_pixbuf_get_file_info() in
> thunar-list-model.c which works not well on certain svg with embedded
> jpg (takes ages to load). Or cause Thunar to crash when clicking on
> empty svg like:
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
> <html><body><svg></svg></body></html>
>
> I supplied a patch which fixes the bug as long as the outcome of
> thunar_file_get_content_type (file) and respectively
> g_file_info_get_content_type() is correct.
>
> However this is not the case on my box. It seems that the result of the
> two functions mentioned changes with the file extension.
> So renaming the empty svg to svg.jpg makes the patch useless and thunar
> crashes again.
>
> Is there a way to determine the type of a file more accurate than
> thunar_file_get_content_type()?
> E.g. can I introduce libgmagic?
>
> Or would it be a better solution to temporally disable the image size
> detection completely until the bug in gdk-pixbuf:
> https://bugzilla.gnome.org/show_bug.cgi?id=647803 is fixed?
>
> kind regards,
> Hubert Hese
> _______________________________________________
> Thunar-dev mailing list
> Thunar-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/thunar-dev
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce4-dev
>



More information about the Xfce4-dev mailing list