Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug with svg marker data defined override for height and width as well as svg url #60590

Open
2 tasks done
robinjonesuk opened this issue Feb 13, 2025 · 0 comments
Open
2 tasks done
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Symbology Related to vector layer symbology or renderers

Comments

@robinjonesuk
Copy link

What is the bug or the crash?

When using data defined overrides on an svg marker for the svg url as well as BOTH height and width of the marker, it changes to display a question mark. This cannot be reversed by clearing the height/width overrides. This only applies if the svg url field is also emptied. This issue is retained when saving the qgs file.

This was discovered when using the overrides to use the project folder as the source for the svg files in both QGIS and Qfield as well as setting different icon sizes for Desktop / Mobile using system variables. The issue was then found to still occur when not using any variables, so the example outlined has been simplified to not use variables.

Steps to reproduce the issue

Only tested so far on Debian 12 with QGIS 3.40.2

create blank project
create new point scratch layer
edit symbology to single symbol and set marker as SVG marker e.g. file /usr/share/qgis/svg/accommodation/accommodation_bed_and_breakfast.svg
cut the file url and paste (within single quotes) into the data defined override for the svg url

(at this stage both the marker and svg marker icons at the top of the symbology settings still show the correct symbol)

Now set a data defined override for BOTH width and height (with or without the "lock aspect ratio" set).
The "Marker" icon now shows a question mark and the "SVG Marker" shows the correct svg symbol.
Clearing the height/width data defined overrides does not reverse this.

If the project is saved and reloaded, the issue is retained and still will not cancel if the height/width overrides are cleared.

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
QGIS version 3.40.2-Bratislava
QGIS code revision a04cc6b
 
Libraries
Qt version 5.15.8
Python version 3.11.2
GDAL/OGR version 3.6.2
PROJ version 9.1.1
EPSG Registry database version v10.076 (2022-08-31)
GEOS version 3.11.1-CAPI-1.17.1
SQLite version 3.40.1
PostgreSQL client version 15.10 (Debian 15.10-0+deb12u1)
SpatiaLite version 5.0.1
QWT version 6.1.4
QScintilla2 version 2.13.3
OS version Debian GNU/Linux 12 (bookworm)
 
Active Python plugins
ImportPhotos 3.0.7
SpreadsheetLayers 2.1.2
qgis_resource_sharing 1.2.0
LocatePoints 0.3.4
network_gt 1.0
qfieldsync v4.12.2
raster_tracer 0.3.3
TomBio 3.4.4
MemoryLayerSaver 5.0.2
grassprovider 2.12.99
processing 2.12.99
db_manager 0.1.20
MetaSearch 0.3.6
QGIS version 3.40.2-Bratislava QGIS code revision [a04cc6b](https://github.com/qgis/QGIS/commit/a04cc6bf127)

Libraries
Qt version
5.15.8
Python version
3.11.2
GDAL/OGR version
3.6.2
PROJ version
9.1.1
EPSG Registry database version
v10.076 (2022-08-31)
GEOS version
3.11.1-CAPI-1.17.1
SQLite version
3.40.1
PostgreSQL client version
15.10 (Debian 15.10-0+deb12u1)
SpatiaLite version
5.0.1
QWT version
6.1.4
QScintilla2 version
2.13.3
OS version
Debian GNU/Linux 12 (bookworm)

Active Python plugins
ImportPhotos
3.0.7
SpreadsheetLayers
2.1.2
qgis_resource_sharing
1.2.0
LocatePoints
0.3.4
network_gt
1.0
qfieldsync
v4.12.2
raster_tracer
0.3.3
TomBio
3.4.4
MemoryLayerSaver
5.0.2
grassprovider
2.12.99
processing
2.12.99
db_manager
0.1.20
MetaSearch
0.3.6

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

In the save qgs file, the following lines are present in the symbology definition that still retains the (inactive) height/width override after they were cleared :

          <data_defined_properties>
            <Option type="Map">
              <Option name="name" value="" type="QString"/>
              <Option name="properties" type="Map">
                **<Option name="height" type="Map">
                  <Option name="active" value="false" type="bool"/>
                  <Option name="type" value="1" type="int"/>
                  <Option name="val" value="" type="QString"/>
                </Option>**
                <Option name="name" type="Map">
                  <Option name="active" value="true" type="bool"/>
                  <Option name="expression" value="'/usr/share/qgis/svg/accommodation/accommodation_bed_and_breakfast.svg'" type="QString"/>
                  <Option name="type" value="3" type="int"/>
                </Option>
                <Option name="offset" type="Map">
                  <Option name="active" value="false" type="bool"/>
                  <Option name="type" value="1" type="int"/>
                  <Option name="val" value="" type="QString"/>
                </Option>
                **<Option name="width" type="Map">
                  <Option name="active" value="false" type="bool"/>
                  <Option name="type" value="1" type="int"/>
                  <Option name="val" value="" type="QString"/>
                </Option>**
              </Option>
              <Option name="type" value="collection" type="QString"/>
            </Option>
          </data_defined_properties>
@robinjonesuk robinjonesuk added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 13, 2025
@agiudiceandrea agiudiceandrea added the Symbology Related to vector layer symbology or renderers label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Symbology Related to vector layer symbology or renderers
Projects
None yet
Development

No branches or pull requests

2 participants