Skip to content

Fix to prevent negative size values in gdal2tiles.py#14101

Open
antonmyagotin wants to merge 1 commit intoOSGeo:masterfrom
antonmyagotin:patch-1
Open

Fix to prevent negative size values in gdal2tiles.py#14101
antonmyagotin wants to merge 1 commit intoOSGeo:masterfrom
antonmyagotin:patch-1

Conversation

@antonmyagotin
Copy link

Problem:
Gdal2tiles crashes with the message "Illegal values for buffer size". The problem was reported in multiple source and exists already for years. Examples:
https://gis.stackexchange.com/questions/249809/gdal2tiles-error-5-illegal-values-for-buffer-size-error-for-a-single-zoom-lev

Solution:
We just skip the tile with negative extent values.

for big geotiff files the tiling craches due to negative values in rxsize, rysize, wxsize, wysize. We just skip the inopropriate tile sizes.
@rouault
Copy link
Member

rouault commented Mar 10, 2026

@antonmyagotin
Copy link
Author

yes, for several big geotiffs I can reproduce the crash

@rouault
Copy link
Member

rouault commented Mar 10, 2026

yes, for several big geotiffs I can reproduce the crash

Please use "gdal_create" with options "-co TILED=YES -co SPARSE_OK=YES" to create an empty file with the same characteristics, and attach it there (zipped), and also the exact gdal2tiles command line you use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants