Bug report #8384
Custom SVG paths incompatible with relative paths
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Symbology | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Windows | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 17157 |
Description
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.
History
#1 Updated by Paolo Cavallini almost 11 years ago
- Target version changed from Version 2.0.0 to Future Release - High Priority
#2 Updated by Giovanni Manghi over 7 years ago
- Easy fix? set to No
- Regression? set to No
#3 Updated by Benoit de Cabissole over 6 years ago
- Status changed from Open to Closed
- Description updated (diff)
#4 Updated by Giovanni Manghi over 6 years ago
- Resolution set to fixed/implemented