qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.49k stars 2.99k forks source link

QGIS 3.22.16: "Project > Export to image "not saving >4GB #51980

Closed smaprs closed 8 months ago

smaprs commented 1 year ago

What is the bug or the crash?

Main menu "Project" > "Export to image" is not saving >4GB, it cuts at 4GB, leaving the image corrupted.
Previous version QGIS 3.16 didn't give that bug.

Steps to reproduce the issue

  1. I tried to export a canvas containing a raster ~63000x20000 px and some vectors, using "Project > Export to image".
  2. Just as many times before I used to do with previous version, I increased resolution (dpi), to increase sizes in pixels to match image native size.
  3. It started to run, but stopped and cut at 4GB, resulting image corrupted. Maybe it's not doing BIGTIFF=YES by default. Also there's no option to tag BIGTIFF=YES But I've never had such problem in previous version. (Alternatively, I could save same canvas as in 2 halves, it did it fast, then joined as VRT, and saved VRT as TIF compressed. It worked, but not as good as simple "Project > Export to image".)

Versions

QGIS 3.22.16

Supported QGIS version

New profile

Additional context

No response

nicogodet commented 1 year ago

Can you share complete detail of your setup (by copy and paste the content of Help-> About as requested in issue form) ?

Can you try on next LTR see if it still happens ? (QGIS 3.28.3)

roya0045 commented 1 year ago

Also you're bound to hit the painter limitation if you haven't already, that's an old upstream limitation. https://doc.qt.io/qt-6/qpainter.html#limitations

smaprs commented 1 year ago

Can you share complete detail of your setup (by copy and paste the content of Help-> About as requested in issue form) ? Can you try on next LTR see if it still happens ? (QGIS 3.28.3)// Wil try, thanks

SETUP: QGIS version 3.22.16-Białowieża QGIS code revision 6f08e4d7 Qt version 5.15.3 Python version 3.9.5 GDAL/OGR version 3.6.2 PROJ version 9.1.1 EPSG Registry database version v10.076 (2022-08-31) GEOS version 3.11.1-CAPI-1.17.1 SQLite version 3.39.4 PDAL version 2.4.3 PostgreSQL client version 14.3 SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.13.1 OS version Windows 10 Version 2009

Active Python plugins FreehandRasterGeoreferencer 0.8.3 HCMGIS 23.2.1 LAStools 1.4 latlontools 3.6.8 polsar_tools 0.7 profiletool 4.2.2 Qgis2threejs 2.7.1 QuickOSM 2.1.1 quick_map_services 0.19.33 SRTM-Downloader 3.1.17 db_manager 0.1.20 grassprovider 2.12.99 processing 2.12.99 sagaprovider 2.12.99

smaprs commented 1 year ago

Can you try on next LTR see if it still happens ? (QGIS 3.28.3)

@nicogodet : But it says Latest Long Term Release = 3.22.16 Białowieża LTR ? ( at https://qgis.org/en/site/forusers/alldownloads.html )
// Is QGIS 3.28.3 really Long Term Release ?

agiudiceandrea commented 1 year ago

@smaprs QGIS 3.28 is the next LTR since the upcoming QGIS 3.28.4. QGIS 3.22.16 is the last release of QGIS 3.22 so the support is ended. @nicogodet see also https://github.com/qgis/QGIS/issues/41045 and https://github.com/qgis/QGIS/pull/41047.

agiudiceandrea commented 1 year ago

@smaprs could you double check that you can export a 63000x20000 px image without issues using QGIS 3.16?

agiudiceandrea commented 1 year ago

@roya0045 maybe you could introduce, for the map export, the same message displaying already introduced by you with https://github.com/qgis/QGIS/pull/41047 for the layout export.

smaprs commented 1 year ago

@smaprs could you double check that you can export a 63000x20000 px image without issues using QGIS 3.16?

Hi, sorry I don't have 3.16 anymore. After upgrading I deleted it

agiudiceandrea commented 1 year ago

@smaprs the previous versions of QGIS 3 are available at https://download.qgis.org/downloads/windows/3/

In order to export the map canvas to an image with "Project" > "Export Map to Image", QGIS (3.16 included) uses the Qt library (not the GDAL library) so the BIGTIFF=YES setting has no effect. The image exported by the Qt library is limited to 32768 pixels in both dimensions https://doc.qt.io/qt-6/qpainter.html#limitations: "any painting performed with coordinates outside this range is not guaranteed to be shown; the drawing may be clipped". 32768px x 32768px x 4bytes (RGBA) = 4GB.

To export the map canvas to an image, it is also available the "Convert map to raster" ("native:rasterize") processing algorithm which uses the GDAL library.

smaprs commented 1 year ago

Thank you much all! Will try it. All the best

alexbruy commented 8 months ago

Duplicates #41045.