Label masking and composer export bug
What is the bug or the crash?
Context : Hiking map with a lot of labels (lakes, peak, saddle, places, ...) and OSM road network.
labels have an active mask property on the road network.
When the Label masking property is activate on road network, an export with composer taker very long time or crash. When the property is disable no problem.
A try on qgis 2.22.4 and there is no problems
Steps to reproduce the issue
Label masking property enable on all label layer and active on road network. Composer export bug
Versions
2.26.3
Supported QGIS version
- [X] I'm running a supported QGIS version according to the roadmap.
New profile
- [X] I tried with a new QGIS profile
Additional context
No response
Could you share a project with sample data?
@troopa81 My project file is posted over on issue #50734 and produces the same symptoms.
On Windows 10, the issue doesn't occur using QGIS 3.22.12, while it does using QGIS 3.28.0 and the latest QGIS 3.29.0-Master (2a3cdfd4c5).
On Windows 10, the issue doesn't occur using QGIS 3.22.12, while it does using QGIS 3.28.0 and the latest QGIS 3.29.0-Master (https://github.com/qgis/QGIS/commit/2a3cdfd4c52e312967b23d48219be7852fb485ce).
I imagine it's related to #47459 which appears on 3.26. In 3.22, the result must be fully rasterized even if you select the option full vector when exporting.
@C4pT4in0bvi0u5 You can disable the full vector export options, it would certainly work and you'll have your masks, but the result will be fully rasterized.
Thanks for the project sample and data, I'll try to take a look at it when I get the time (not quite soon I'm afraid).
@troopa81 I don't see any "rasterize" or "vector" options when printing from layout or exporting to PNG. So not sure what exactly you're talking about. I seem to remember a "vector" setting for PDF somewhere, but this is not a problem that is limited to PDF.
Doesn't matter anyway, because there is clearly a problem with printing/exporting in 3.26 and up. Just use 3.22.12 if you want something that works. Trying to find workarounds seems pointless to me.
Doesn't matter anyway, because there is clearly a problem with printing/exporting in 3.26 and up. Just use 3.22.12 if you want something that works. Trying to find workarounds seems pointless to me.
There is clearly an issue, but I would like to be sure it's only related to export with full vector option (see this comment) and it's the same issue than #50785
Are you sure that you have the issue when you export in PNG ? If yes, could you please share the stacktrace when it crashes!
Are you sure that you have the issue when you export in PNG
Yes, the issue occurs exporting in PNG.
Are you sure that you have the issue when you export in PNG ?
Yes. Quite sure.
please share the stacktrace when it crashes!
No idea how to get a stacktrace. This is NOT a difficult problem to reproduce.
A duplicate issue report contains a stack trace: https://github.com/qgis/QGIS/issues/50785#issuecomment-1302601665.
Hi! Any news on this issue? I have the same problem. Just disable the option to mask the labels so that the export in any format works again. QGIS 3.24.3 works fine, but 3.26.x and 3.28.x fail. The maps I export have many layers and generate large files, so it's difficult to get the error log (stracktrace) when QGIS crashes.
Any news on this issue?
Yes, like I said in this comment, and contrary to what I thought, there is no way to have a full raster-only rendering, and the vector way of rendering selective masking is very slow.
I try to find a solution to this.
I too seem to have run into this problem. When using label masking and exporting as raster file, i sometimes get the crash (without any error popping up). It seems to be an intermittent issue, so maybe related to memory handling? If needed i can help test any bug fix or provide more details on the problem.
I have the same issue, map size goes from 3MB to 98.6MB. If I mask additional layers with my unique mask, it crashes while exporting.
Are there any news on this very annoying bug, that practically renders inusable a great deal of Qgis?
Same for us, a big cartographic agency in Germany: selective masking is a great feature of QGIS, but we have to stay at version 3.22 to export the maps in a raster format. In future hopefully also in vector format. Would be great to see progress with this bug.
Hi @tdeboss and @jsehner I'm well aware about this issue and I don't fortget it. However, I fail to find time to improve things here.
If you're interested in funding you can contact me here : julien dot cabieces at oslandia dot com
Otherwise, I'll try to fix it in the next QGIS bugfix round
See also: https://github.com/qgis/QGIS/issues/55874.
How's it going with this? This problem is still very annoying since I still have to use 3.24.3 in order to export images from QGIS. It's been over two years now...
Since then we're using silicon Macs and with the new ARM64 versions of QGIS which is so much faster. But this new version still can't export images.
I failed to find the time to work on this in the previous bug fix round.
I failed to find the time to work on this in the previous bug fix round.
I emailed you the other day to see if you could get an estimate on fixing this. Did you get it?
Hello,
Same problem here, with 3.34 version. When label masking is turned on both map composer exports and screenshot exports hang for 10 minutes or so. The output is broken, transparency seems to be reverted to 0%, in spite of layer symbology settings.
It took me quite a while to discover the cause of the problem - this issue is probably affecting a large number of users who may be unaware of the cause.
Long time problem(s). Several time closed "because no activity in thread". I have to use QGIS 3.22 for output.
Maybe we could go together and finance this? @troopa81 is interested to help out.
Several time closed "because no activity in thread"
This issue repor was never been closed.
QGIS v3.38.0RC is confirmed working. Thank you for fixing this huge bug!
[EDIT:} Nope, still glitching. See below.
@troopa81, I think this issue report can be closed now.
@C4pT4in0bvi0u5
You should try switching to the new geometry based backend, which will give much better results on QGIS 3.38+ (and MUCH better results on 3.38.1, when that's released.)
From the Python console enter:
QgsSettings().setValue('map/mask-backend', 'geometry')
QGIS v3.38.0 is confirmed working. Thank you for fixing this huge bug!
All modifications brought recently by @nyalldawson are non default, so I'm wondering how it could actually work.
I'm hesitating at closing this, because I think the issue still exists. @nyalldawson What do you think?
3.38.0 took a bloody long time to finish rendering... but it completed the render, gave me a usable file, and didn't crash. That's progress.
I'm using QGIS in stock configuration.
To be fair, as there has been basically no activity on this bug for the last 2 years, I had no reason to check every QGIS version that came out. I've been using the known-working 3.22.12 version. So perhaps the crashing issue was "accidentally" fixed before now?
@C4pT4in0bvi0u5 can you confirm you tried with the qsettings switch to the new backend?