-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Creating SVG image icons is slow in Print composer #17182
Comments
Author Name: Giovanni Manghi (@gioman) Do you have additionals SVG files other than the ones installed by default? It is just a Windows issue, right?
|
Author Name: Giovanni Manghi (@gioman) Confirmed on Windows.
|
Author Name: Larry Shaffer (Larry Shaffer) 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. Do the same logged errors show up when the SVG previews are shown in symbology dialog? |
Author Name: Giovanni Manghi (@gioman) Larry Shaffer wrote:
no. 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?
|
Author Name: Larry Shaffer (Larry Shaffer) Ok, I've tracked down the issue, but not sure how to fix it. Running the following from PyQGIS shell, gives a similar Qt warning (output to the Log Messages panel):
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). 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. 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. 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 @QgsComposerPictureWidget::addDirectoryToPreview@. On a side note: this is not really a release blocker, since the flooding of warnings to Log Messages probably does not occur. |
Author Name: Pekka Sarkola (@posikifi) 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. Reply to sidenote about blocker: maybe not for a release, but for my case. I wasn't sure what it means (blocker). |
Author Name: Larry Shaffer (Larry Shaffer) Pekka Sarkola wrote:
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. 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.
It's certainly a blocker for those using a debug build on Windows, though. :^) |
Author Name: Nathan Woodrow (@NathanW2) Fixed in changeset "ee268984de32d631ee5cd57dd895dc8d8977000e".
|
Author Name: Nathan Woodrow (@NathanW2) 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. |
Author Name: Larry Shaffer (Larry Shaffer) Thanks Nathan, Maybe a more specific string comparison, so it doesn't mask other QColor::setNamedColor warnings/errors?
or, a regex comparison?
|
Author Name: Pekka Sarkola (@posikifi)
Original Redmine Issue: 8411
Affected QGIS version: master
I create new print composer, then add Image. When I open "Search directories" to select SVG image, QGIS just start to create preview icons: this took hours.
QGIS is logging messages from QT: "QColor::setNamedColor:Unknown color name 'param(fill) #FFF', see image
Tested also in Ubuntu: works fine. In older version (1.8.0): works just fine. Qgis Master version 018e958
This blocks use of QGIS Print Composer (at least in my case)
The text was updated successfully, but these errors were encountered: