https://issues.qgis.org/https://issues.qgis.org/favicon.ico2012-12-11T15:59:47ZQGIS Issue TrackingQGIS Application - Bug report #6855: SVG with map units crasheshttps://issues.qgis.org/issues/6855?journal_id=376492012-12-11T15:59:47ZLarry Shaffer
<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>I have a fix for this in a pull request with other SVG symbol fixes:</p>
<p><a class="external" href="https://github.com/qgis/Quantum-GIS/pull/353/commits">https://github.com/qgis/Quantum-GIS/pull/353/commits</a> (commit 33e16fd)</p>
<p>Basically, any SVG symbol stored in the QgsSvgCache as a QImage (default for non-rotated symbols) that is larger than 790 px X 790 px X 32 bit (for transparency) exceeds current cache size. When QgsSvgCache::trimToMaximumSize() was called after storing QImages that were larger than the cache, a very funky QImage was returned, causing the crash.</p>
<p>Now, when a SVG symbol's size would cause it's stored QImage to exceed the maximum cache size, a QPicture is saved instead, and that is used to render the symbol. QPicture is already used when a SVG symbol is rotated (QImage method produces jagged renderings), but is slower than rendering the cached QImage.</p>
<p>Now you should be able to excessively zoom into the SVG. Making sure the point feature is always in the extent, I have zoomed into a SVG symbol up to 5,000,000 ^ 2 virtual pixel area. At first the symbol is a QImage, then it becomes a QPicture. This increases the memory usage significantly (jumps to ~ 2 GB on my i7 iMac when way zoomed in). There should probably be a cap to the dimensional size of a SVG QPicture that is cached, maybe 10,000 ^ 2, which would then cache a null, 0/0 or very small transparent QPicture (or skip rendering the symbol completely).</p> QGIS Application - Bug report #6855: SVG with map units crasheshttps://issues.qgis.org/issues/6855?journal_id=376512012-12-11T21:42:02ZBernhard Ströblbernhard.stroebl@jena.de
<ul></ul><p>Larry,</p>
<p>I am going to come back this issue when your pull requests have been merged. Anyways: do I understand that you would not recommend to use map units with svg symbols on low RAM (~1GB) machines (even after the fix)?</p> QGIS Application - Bug report #6855: SVG with map units crasheshttps://issues.qgis.org/issues/6855?journal_id=379272012-12-27T23:45:00ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Operating System</strong> deleted (<del><i>any</i></del>)</li></ul><p>Bernhard Ströbl wrote:</p>
<blockquote>
<p>Larry,</p>
<p>I am going to come back this issue when your pull requests have been merged. Anyways: do I understand that you would not recommend to use map units with svg symbols on low RAM (~1GB) machines (even after the fix)?</p>
</blockquote>
<p>the pull request have been committed, what is the status of this ticket?</p> QGIS Application - Bug report #6855: SVG with map units crasheshttps://issues.qgis.org/issues/6855?journal_id=379382012-12-28T11:46:11ZLarry Shaffer
<ul></ul><p>The fix has not been committed yet (latest pull request):</p>
<p><a class="external" href="https://github.com/qgis/Quantum-GIS/pull/359">https://github.com/qgis/Quantum-GIS/pull/359</a></p>
<p>That request handles both marker and fill symbols, and keeps the RAM usage to a minimum (generally 300 MB to under 1 GB with heavy-to-full cache usage), and causes no crashes (at least on Mac). The code needs reviewed by Dr. Marco, since it is a significant change to how SVG symbols gets cached, and the memory management needs proofed as well.</p> QGIS Application - Bug report #6855: SVG with map units crasheshttps://issues.qgis.org/issues/6855?journal_id=379942012-12-30T08:46:54ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Priority</strong> changed from <i>Normal</i> to <i>High</i></li></ul> QGIS Application - Bug report #6855: SVG with map units crasheshttps://issues.qgis.org/issues/6855?journal_id=381812013-01-04T00:19:49ZLarry Shaffer
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul><p>Fixed in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/6a936b936bdbc189293c3e330da9404399034b71" title="Draw SVG symbol from cached QImage unless it exceeds half of cache size, then use QPicture - Fix...">6a936b936bdbc189293c3e330da9404399034b71</a>.</p>