From xfce at hubertscorner.de Fri Apr 29 00:04:19 2011 From: xfce at hubertscorner.de (Hubert Hesse) Date: Fri, 29 Apr 2011 00:04:19 +0200 Subject: [Thunar-dev] Proper way to determine the type of a file more accurate than thunar_file_get_content_type() Message-ID: <4DB9E463.7010800@hubertscorner.de> 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:
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