https://issues.qgis.org/https://issues.qgis.org/favicon.ico2013-08-05T07:49:12ZQGIS Issue TrackingQGIS Application - Bug report #8411: Creating SVG image icons is slow in Print composerhttps://issues.qgis.org/issues/8411?journal_id=437992013-08-05T07:49:12ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li><li><strong>Target version</strong> set to <i>Version 2.0.0</i></li></ul><p>Do you have additionals SVG files other than the ones installed by default? It is just a Windows issue, right?</p> QGIS Application - Bug report #8411: Creating SVG image icons is slow in Print composerhttps://issues.qgis.org/issues/8411?journal_id=438022013-08-05T08:09:50ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Open</i></li></ul><p>Confirmed on Windows.</p> QGIS Application - Bug report #8411: Creating SVG image icons is slow in Print composerhttps://issues.qgis.org/issues/8411?journal_id=438082013-08-05T08:48:18ZLarry Shaffer
<ul></ul><p>No issue on Mac (10.7.5). May be the QSvgRenderer on Windows (Qt 4.7.1 ?) is having issues with the new SVG symbol library.</p>
<p>Do the same logged errors show up when the SVG previews are shown in symbology dialog?</p> QGIS Application - Bug report #8411: Creating SVG image icons is slow in Print composerhttps://issues.qgis.org/issues/8411?journal_id=438092013-08-05T08:51:16ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/download/6119/09.png">09.png</a> added</li></ul><p>Larry Shaffer wrote:</p>
<blockquote>
<p>No issue on Mac (10.7.5). May be the QSvgRenderer on Windows (Qt 4.7.1 ?) is having issues with the new SVG symbol library.</p>
<p>Do the same logged errors show up when the SVG previews are shown in symbology dialog?</p>
</blockquote>
<p>no.</p>
<p>Unrelated: see attached screenshot. Almost all svg symbols now render with no fill and a very clear outline, and they are hard to see. Is this right?</p> QGIS Application - Bug report #8411: Creating SVG image icons is slow in Print composerhttps://issues.qgis.org/issues/8411?journal_id=438112013-08-05T14:31:28ZLarry Shaffer
<ul></ul><p>Ok, I've tracked down the issue, but not sure how to fix it.</p>
<p>Running the following from PyQGIS shell, gives a similar Qt warning (output to the Log Messages panel):</p>
<pre>
from PyQt4.QtSvg import QSvgRenderer
QSvgRenderer("C:/OSGeo4W/apps/qgis-dev/svg/backgrounds/background_square.svg")
# which produces these warnings
QColor::setNamedColor: Unknown color name 'param(fill) #FFF'
QColor::setNamedColor: Unknown color name 'param(outline) #000'
</pre>
<p>When I removed all but that SVG file from the standard app SVG library, I got a repetition of 4 (8 total warnings) for testing and rendering that single file to the QgsComposerPictureWidget's icon view. This means the Log Messages panel is flooded with messages when trying to load all the default SVGs to the view. This is what causes the slowness, not necessarily the warnings themselves (at least I'm pretty sure).</p>
<p>The extra logging appears to be related to improvements Jürgen has done for Windows in main.cpp. The same issue might happen on Mac, except that loading the SVG file into the QSvgRenderer on Mac does not produce any warnings.</p>
<p>Those same Qt warnings also showed up when launching any project that already has a composer picture item in its layout, which, for some projects, slowed down their launching.</p>
<p>I was not able to determine why the QgsSvgCache rendered the same SVG file without logging those warnings. Also, I was not able to see how to disable those warnings specifically for <code>QgsComposerPictureWidget::addDirectoryToPreview</code>.</p>
<p>On a side note: this is not really a release blocker, since the flooding of warnings to Log Messages probably does not occur.</p> QGIS Application - Bug report #8411: Creating SVG image icons is slow in Print composerhttps://issues.qgis.org/issues/8411?journal_id=438122013-08-05T21:05:59ZPekka Sarkola
<ul></ul><p>So, if slowness is coming from logging of warnings: workaround could be disable logging. Not very nice. Maybe there should be somewhere possibility to disable all loggings. IMHO: logging should be disabled by definition, only advanced users/developers need logging.</p>
<p>Reply to sidenote about blocker: maybe not for a release, but for my case. I wasn't sure what it means (blocker).</p> QGIS Application - Bug report #8411: Creating SVG image icons is slow in Print composerhttps://issues.qgis.org/issues/8411?journal_id=438302013-08-06T10:30:08ZLarry Shaffer
<ul></ul><p>Pekka Sarkola wrote:</p>
<blockquote>
<p>So, if slowness is coming from logging of warnings: workaround could be disable logging. Not very nice. Maybe there should be somewhere possibility to disable all loggings. IMHO: logging should be disabled by definition, only advanced users/developers need logging.</p>
</blockquote>
<p>Logging is disabled for the release builds. Generally, nightly builds of the master branch (like you are using) are built with debugging output on, because they are intended to be used for testing. If you took the current master and built it as a release variant, the problem would probably not present itself. I am assuming the issue of the SVG params not being read by the Windows QSvgRenderer has been around for quite some time, with new logging tools just having exposed it.</p>
<p>Not sure how to turn logging off for the debug builds, with regards to this issue, however. Still curious why those rendered SVGs in QgsSvgCache (canvas SVG marker symbology or the SVG picker in symbology) are not logging the warnings.</p>
<blockquote>
<p>Reply to sidenote about blocker: maybe not for a release, but for my case. I wasn't sure what it means (blocker).</p>
</blockquote>
<p>It's certainly a blocker for those using a debug build on Windows, though. :^)</p> QGIS Application - Bug report #8411: Creating SVG image icons is slow in Print composerhttps://issues.qgis.org/issues/8411?journal_id=438562013-08-07T15:20:36ZNathan Woodrow
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Fixed in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/ee268984de32d631ee5cd57dd895dc8d8977000e" title="Fix #8411 Suppress warnings for setNamedColour. Warnings reneder composer unusable on windows, e...">ee268984de32d631ee5cd57dd895dc8d8977000e</a>.</p> QGIS Application - Bug report #8411: Creating SVG image icons is slow in Print composerhttps://issues.qgis.org/issues/8411?journal_id=438572013-08-07T15:25:59ZNathan Woodrow
<ul></ul><p>This is fixed now by suppressing the warning for setNamedColor. It's not ideal but having a slow composer when using SVG isn't good because it can mask other issues.</p> QGIS Application - Bug report #8411: Creating SVG image icons is slow in Print composerhttps://issues.qgis.org/issues/8411?journal_id=438582013-08-07T15:35:42ZLarry Shaffer
<ul></ul><p>Thanks Nathan,</p>
<p>Maybe a more specific string comparison, so it doesn't mask other QColor::setNamedColor warnings/errors?</p>
<pre>
QColor::setNamedColor: Unknown color name 'param(
</pre>
<p>or, a regex comparison?</p>
<pre>
QColor::setNamedColor:[^']*'param\\(
</pre>