Bug report #10599

Composer blank page - QPixmap It is not safe to use pixmaps outside the GUI thread

Added by Pedro Venâncio over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:19004

Description

When I try to print (to the printer) a map in Composer, with just raster data in canvas, I get a blank page.

If the composer has grids, annotations, legend, images, etc., everything is printed correctly, except the raster data from canvas, that does not appear, and I get the QT log message:

QPixmap: It is not safe to use pixmaps outside the GUI thread (Level 1).

Also, if I have vector data on canvas, they are printed correctly, only the raster data does not and throws that message (it happens both with raster data in GeoTIFF file format, as in WMS).

This only happens when printing to the printer. Exporting to image, pdf or svg, everything works fine.

To reproduce:
1. Open QGIS and load a raster layer or WMS layer;
2. New print composer;
3. Add new map;
4. Print... (Ctrl+P);
5. Check Log Messages and Print Output.

Tested on Windows 7 (64 bits) with QGIS master 2.3.0-103 (5eddb74).

Associated revisions

Revision 7aa93c00
Added by Martin Dobias over 6 years ago

Hopefully fix #10599 (blank composer map when rendering rasters)

When printing on Windows, the printing does not seem to work
well in the worker thread as QImages get converted to QPixmaps.
Therefore we force the map rendering into main thread to avoid the issues.

I do not have a printer, so I can't confirm the fix really helps

History

#1 Updated by Pedro Venâncio over 6 years ago

I did some tests on other machines:

- Windows 7 with QGIS master (OSGeo4W 64bits) -> this is the same environment as the first machine and I get the same error and blank output;

- Windows 7 with QGIS master (OSGeo4W 32bits) -> everything ok, prints without problems;

- Linux Ubuntu 12.04 32bits with QGIS master -> everything ok, prints without problems.

So the problem seems to be only on 64bit versions of QGIS. I have no 64bit Linux machine where I can test.

#2 Updated by Martin Dobias over 6 years ago

  • Status changed from Open to Feedback

I do not have a printer here to test with printer, but with export to PDF everything works for me on win/64.

Does PDF output work for you or does it end up with the same problem?

#3 Updated by Pedro Venâncio over 6 years ago

Hi Martin,

No, exporting to image, pdf or svg, works fine. The problem is just when printing to the printer.

#4 Updated by Pedro Venâncio over 6 years ago

I can not give more precise information about the error, because I can only do debug on Linux 32bits, and this problem does not appear in 32bits.

But it seems to me a serious problem.

If someone can test and confirm, please do it.

#5 Updated by Andreas Neumann over 6 years ago

I have the very same issues.

Rasters don't print anymore when directly printing to the printer. PDF export is fine.

QGIS 2.2 works fine with the same printers.

#6 Updated by Andreas Neumann over 6 years ago

Forgot to say that this is also on Windows 7 64bit version.

#7 Updated by Martin Dobias over 6 years ago

  • Status changed from Feedback to Closed

#8 Updated by Pedro Venâncio over 6 years ago

I confirm the fix on Win7 (OSGeo4W 64bits)!

Thank you very much Martin!

#9 Updated by Andreas Neumann over 6 years ago

I can also confirm that printing rasters works again on Win7 64bit. Thank you for the fix!

Also available in: Atom PDF