Bug report #8384

Updated by Benoit de Cabissole over 6 years ago

Problems with SVG paths (custom SVG paths incompatible with relative path) - QGIS f779592



1) No ‘memory’ of custom ‘SVG path’:

- The path to custom SVG files in defined in “SVG paths” in Options->System.

- Below this path are subfolders that contain the actual SVG files.

- When styling a polygon I use: Fill->SVG Fill in the Symbol selector.

- The list of all SVG files in the SVG path and its subfolders is displayed.

- I select a SVG fill and click Ok, then Apply in the Layers Properties. The polygon is correctly filled with the SVG fill.

- Save the style ‘Save Style’ button (.qml) in Layers Properties.

- Get out of the Layer Properties and then save the project (.qgs).

- Get out of QGIS and re-open the project: the SVG fill has disappeared!

- Open Layers Properties and ‘Load Style…’. The SVG fill has also disappeared!



A look into the .qml file shows that +only+ the relative path *from the saved ‘SVG paths’* to the custom SVG fill file is saved. It seems that if a custom ‘SVG paths’ is defined then QGIS is unable to use it and only uses relative paths from the default SVG folder.



2) ‘Saved styles’ should save (copy) the style to a QGIS-system folder (either under user/.qgis2, or in the QGIS application folder).

- The path to custom SVG files in defined in “SVG paths” in Options->System.

- Below this path are subfolders that contain the actual SVG files.

- When styling a polygon I use: Fill->SVG Fill in the Symbol selector.

- The list of all SVG files in the SVG path and its subfolders is displayed.

- I select a SVG fill then click the ‘Fill’ item in the list and then the ‘Symbol’ button and ‘Save in symbol library…’. The new symbol is displayed in the list. All good.

- Click Ok, then Apply in the Layers Properties. The polygon is correctly filled with the SVG fill.

- Go to another polygon layer and open its Properties. The just defined symbol is there to be use. Still very good.

- Save project and close QGIS.

- Load the project in a new QGIS session and the custom symbol defined in the previous session is only a shadow of itself: its name and placeholder are there but the SVG symbol is gone!



Again, it seems to be a relative path problem.



I would strongly suggest that all symbols saved to the library are physically copied to a QGIS-system folder: either under user/.qgis2, or in the QGIS application folder. The symbols in the library should be available at anytime, even if the original symbol was on a removable drive/internet that is not available anymore.

Back