Comment 11 for bug 270990

Revision history for this message
Olivier Clavel (zeitounator) wrote :

I have spoted the problem against the latest version of the code from bzr.

File: src/extension/svg.cpp
Method: Svg::open

If compiled with gnome vfs, we go through line 196 which chekcs if gnome_vfs is uninitialised or if the uri of the file is local. In that case, the built-in loader is used

For files situated on an nfs share, gnome_vfs_uri_is_local(gnome_vfs_uri_new(uri)) returns false so we go through the rest of the code (lines 200-208). What happens here basically is that we ask gnome_vfs to open the file and load it's content to memory to later create a doc from it. But in that case, the file is read literally to memory with the private method _load_uri which does not seem to be able to make a difference between compressed or uncompressed data. In the case of .svg it works correctly. In the case of svgz, the xml parser will fire an error at opening time since the compressed data does not reflect a valid xml.

I have no idea why there was originally a difference in the code between local and remote file ressources and why. Meanwhile, keeping code that does the job and trying the simplest fix, I was able to open svgz file on nfs with the following attached patch.