Svg files with embeded images created with inkscape cause the current thunar window to freeze for an amount of time relative to the size of the file. Does it even if display thumbnails is turned off in the preferences. Machine 1.6 core 2 2G of ram
Created attachment 1000 An svg test file An example svg test file that causes the problem.
That happens only if you select such a file, right?
(In reply to comment #2) > That happens only if you select such a file, right? > No, it happens when you browse into the directory were the file is located. You cannot select the file or do any other operation in this window until it unfreezes (10Meg file ~30 Sec).
I am also running into this problem in 0.9.0. Thunar does not freeze when I open the directory containing the SVG file(s), but does freeze when I select the file - either by mouseover (using single-click activation in thunar) or clicking (double-click activation). Running dual 3.6GHz Xeon w/ 4GB RAM and still can have 10-30s of freeze time. Images do not need to be embedded to cause this problem - even linked images will cause a freeze.
Created attachment 3610 Call of the broken gdk function. Replace with your prepared SVG. Compile it. E.g. with gcc file_info.c -o file_info `pkg-config --cflags --libs glib-2.0` `pkg-config --cflags --libs gdk-pixbuf-2.0`
The problem comes from a probably broken gdk function gdk_pixbuf_get_file_info() in thunar-list-model.c The enlightenment developers also came across that problem. http://www.mail-archive.com/enlightenment-cvs@lists.sourceforge.net/msg07711.html I would recommend to skip image size calculation and the the call gdk function for svgs for now. I'll investigate further possible solutions.
I reported the bug in gdk_pixbuf_get_file_info () here https://bugzilla.gnome.org/show_bug.cgi?id=647803.
Created attachment 3640 Introducing an Adapter which stops the call of the broken gdk function for svg Introduce an Adapter for gdk_pixbuf_get_file_info(). Since its broken for SVGs the adapter stops the call of the function for that type of files..
Created attachment 3675 there can be null pointer in height and width from thunar_file_get_image_size This fixes the segfault through an empty svg.
Created attachment 3679 Use libmagic for preventing gdk_pixbuf svg bug Due to limited knowledge of automake. I had to add LIBS = -lmagic to the generated Makefile in thunar/thunar. If there is the wish I will look further into this.
Created attachment 3705 Use libmagic for preventing gdk_pixbuf svg bug. Link via autotools Introduce --with-magic for checking the type of a file via libmagic. (Disabled by default)
Summary Problem: 1.Select a svg files with embeded images cause thunar window to freeze. Freeze time is proportional to the size of the file. 2.Svg files with an invalid size, e.g empty svg, cause thunar to crash. Discussion: The problem origins from a broken gdk function gdk_pixbuf_get_file_info() in thunar-list-model.c and was reported before in Enlightenment in 2004 [1]. They assumed a static size of 64x64px for every svg, which is sufficient for SVG icons. I suggest to skip the computation of the size for svg files entirely. The first patch: attachment 3675 introduces an adapter which does that identifying the type of the file using thunar's functions. This adapter also checks if the returned width && height is valid to solve the second problem. However the first doesn't work if the svg is hidden behind a wrong extension, because this is how the thunar function determine the type of a file. The second patch: attachment 3705 , which builds upon the first one, solves this using libmagic instead. [1] http://www.mail-archive.com/enlightenment-cvs@lists.sourceforge.net/msg07711.html The Bug report from gdk-pixbuf is located here: https://bugzilla.gnome.org/show_bug.cgi?id=647803.
For convenience I pushed my fix here: https://github.com/hubx/thunar/branches/bug2913 I reverted attachment 3675 to attachment 3640 there, because width & height are no pointers in this situation. As a consequence it can't trigger a segfault. Although one could discuss if zero size have to appear in the status text.
Any chance this will be merged soon?
*** Bug 7892 has been marked as a duplicate of this bug. ***
Fixed (or: workaround) in d9129c8.