After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 647803 - gdk_pixbuf_get_file_info() takes very long to determine the size of svgs with embedded jpgs
gdk_pixbuf_get_file_info() takes very long to determine the size of svgs with...
Status: RESOLVED OBSOLETE
Product: librsvg
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-14 18:36 UTC by Hubert Hesse
Modified: 2017-12-13 17:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Call of the broken gdk function. (187 bytes, text/plain)
2011-04-14 18:36 UTC, Hubert Hesse
Details

Description Hubert Hesse 2011-04-14 18:36:37 UTC
Created attachment 185974 [details]
Call of the broken gdk function.

See: 
http://www.mail-archive.com/enlightenment-cvs@lists.sourceforge.net/msg07711.html
and
https://bugzilla.xfce.org/show_bug.cgi?id=2913

I could reproduce it with 2.23.3 with this file and the attached source:
https://hubertscorner.de/drawing.svg

Takes ~30 secs on my machine and as a result all programs which try determine the size of an svg that way
Comment 1 Hubert Hesse 2011-04-26 08:47:52 UTC
This may be a related issue:
gdk_pixbuf_get_file_info() crashes for the following file.

foo.svg:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<html><body><svg></svg></body></html>

I've tested it with the following programm:

file_info.c;
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf-io.h>

void main(){
    g_type_init();
    gint height, width;
    gdk_pixbuf_get_file_info("/path/to/foo.svg", &width, &height);
}


$ ./file_info

(process:12606): GLib-CRITICAL **: g_hash_table_size: assertion `hash_table != NULL' failed

(process:12606): GdkPixbuf-CRITICAL **: info_cb: assertion `width > 0 && height > 0' failed
Comment 2 Hubert Hesse 2011-04-28 22:00:09 UTC
I mixed things up. The program in the previous comment does not crash. However the output is right.
Comment 3 Christian Persch 2011-12-16 22:17:06 UTC
I can repro the problem with the empty svg from comment 1. However, I cannot retrieve the testcase from comment 0 since its server is down; any chance you can put it somewhere else or attach it here?
Comment 4 Hubert Hesse 2011-12-17 20:57:53 UTC
It put it back at http://hubertscorner.de/drawing.svg (note the missing https)
You can easily reproduce such a svg file. just open inkscape, embed a jpeg file and copy & paste it multiple times.
I think what happens it that the whole file is read to calculate the image’s dimensions, which is possible according the documentation of GDK.
There can be a width and height attribute in SVGs top XML element to make it possible to determine the size of a SVG file in constant time. However both are not mandatory and as far as I can tell GDK ignores them.
I can reproduce it with 2.24.0
Comment 5 GNOME Infrastructure Team 2017-12-13 17:47:20 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/librsvg/issues/51.