QGIS icon indicating copy to clipboard operation
QGIS copied to clipboard

Label masking and composer export bug

Open eprouteau opened this issue 3 years ago • 24 comments

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

eprouteau avatar Oct 13 '22 16:10 eprouteau

Could you share a project with sample data?

troopa81 avatar Oct 14 '22 07:10 troopa81

@troopa81 My project file is posted over on issue #50734 and produces the same symptoms.

C4pT4in0bvi0u5 avatar Nov 02 '22 17:11 C4pT4in0bvi0u5

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).

agiudiceandrea avatar Nov 02 '22 18:11 agiudiceandrea

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 avatar Nov 03 '22 18:11 troopa81

@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.

C4pT4in0bvi0u5 avatar Nov 04 '22 22:11 C4pT4in0bvi0u5

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!

troopa81 avatar Nov 07 '22 08:11 troopa81

Are you sure that you have the issue when you export in PNG

Yes, the issue occurs exporting in PNG.

agiudiceandrea avatar Nov 07 '22 14:11 agiudiceandrea

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.

C4pT4in0bvi0u5 avatar Nov 08 '22 06:11 C4pT4in0bvi0u5

A duplicate issue report contains a stack trace: https://github.com/qgis/QGIS/issues/50785#issuecomment-1302601665.

agiudiceandrea avatar Nov 10 '22 17:11 agiudiceandrea

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.

MarcelFernandesCGEO avatar Nov 24 '22 11:11 MarcelFernandesCGEO

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.

troopa81 avatar Nov 28 '22 16:11 troopa81

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.

syntax42 avatar Dec 03 '22 11:12 syntax42

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.

CharlesGag avatar Dec 15 '22 13:12 CharlesGag

Are there any news on this very annoying bug, that practically renders inusable a great deal of Qgis?

tdeboss avatar Apr 10 '23 17:04 tdeboss

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.

jsehner avatar Apr 10 '23 18:04 jsehner

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

troopa81 avatar Apr 25 '23 07:04 troopa81

See also: https://github.com/qgis/QGIS/issues/55874.

agiudiceandrea avatar Jan 17 '24 18:01 agiudiceandrea

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.

oskarlin avatar Feb 29 '24 09:02 oskarlin

I failed to find the time to work on this in the previous bug fix round.

troopa81 avatar Feb 29 '24 14:02 troopa81

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?

oskarlin avatar Mar 07 '24 13:03 oskarlin

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.

zoran-cuckovic avatar May 13 '24 09:05 zoran-cuckovic

Long time problem(s). Several time closed "because no activity in thread". I have to use QGIS 3.22 for output.

FeroS66 avatar May 14 '24 10:05 FeroS66

Maybe we could go together and finance this? @troopa81 is interested to help out.

oskarlin avatar May 14 '24 10:05 oskarlin

Several time closed "because no activity in thread"

This issue repor was never been closed.

agiudiceandrea avatar May 14 '24 11:05 agiudiceandrea

QGIS v3.38.0RC is confirmed working. Thank you for fixing this huge bug!

[EDIT:} Nope, still glitching. See below.

C4pT4in0bvi0u5 avatar Jun 23 '24 05:06 C4pT4in0bvi0u5

@troopa81, I think this issue report can be closed now.

agiudiceandrea avatar Jun 23 '24 06:06 agiudiceandrea

@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')

nyalldawson avatar Jun 23 '24 22:06 nyalldawson

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?

troopa81 avatar Jun 24 '24 07:06 troopa81

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 avatar Jun 24 '24 07:06 C4pT4in0bvi0u5

@C4pT4in0bvi0u5 can you confirm you tried with the qsettings switch to the new backend?

nyalldawson avatar Jun 24 '24 10:06 nyalldawson