-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
SVG with map units crashes #15989
Comments
Author Name: Larry Shaffer (Larry Shaffer) I have a fix for this in a pull request with other SVG symbol fixes: https://github.com/qgis/Quantum-GIS/pull/353/commits (commit 33e16fd) 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. 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. 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).
|
Author Name: Bernhard Ströbl (Bernhard Ströbl) Larry, 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)? |
Author Name: Giovanni Manghi (@gioman) Bernhard Ströbl wrote:
the pull request have been committed, what is the status of this ticket?
|
Author Name: Larry Shaffer (Larry Shaffer) The fix has not been committed yet (latest pull request): 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. |
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Larry Shaffer (Larry Shaffer) Fixed in changeset "6a936b936bdbc189293c3e330da9404399034b71".
|
Author Name: Bernhard Ströbl (Bernhard Ströbl)
Original Redmine Issue: 6855
Affected QGIS version: master
Redmine category:symbology
To reproduce:
tried with 1.8 on WinXP and Linux(64 bit) and master on Linux(64 bit)
tried with different svg files
The text was updated successfully, but these errors were encountered: