Bug report #7935
SVG paths still absolute if project set to use relative paths
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||ubuntu||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||not reproducable|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||16804|
I am distributing a project that uses custom svg symbols, hence it has a local, relative svg directory. However, even if I set the project to use relative paths, the svg symbol paths are saved as absolute paths, meaning that we have to edit the project file manually to make them relative.
So, if a project is set to use relative paths then ALL paths should be relative.
#2 Updated by Alister Hood almost 7 years ago
Doesn't look like it to me, although I haven't tested with a custom svg path:
<renderer-v2 symbollevels="0" type="singleSymbol">
<symbol alpha="1" type="marker" name="0">
<layer pass="0" class="SvgMarker" locked="0">
<prop k="angle" v="0"/>
<prop k="fill" v="#000000"/>
<prop k="horizontal_anchor_point" v="1"/>
<prop k="name" v="wind_roses/WindRose_01.svg"/>
#3 Updated by Alister Hood almost 7 years ago
Oh, I see. If the svg is in the QGIS install directory (on my system /usr/share/qgis/svg) or the user's directory (~/.qgis2//svg) then the path is saved as relative. If the svg is in the same directory as the .qgs project file (including subdirectories) then the path is saved as relative. If the svg is somewhere else in the filesystem then the path is saved as absolute.
So if you wanted to use a setup something like this (which seems like not a bad idea) the relative paths wouldn't work:
//server name/QGIS stuff/
//server name/QGIS stuff/Projects/
//server name/QGIS stuff/SVGS/