commenthol/gdal2tiles-leaflet

Generating tiles return empty tiles directories tree

SteeveGL opened this issue · 2 comments

I cloned the project and tested it as well. No problem. But when I try it with My own image the result is just empty directories, no images inside.

I exported the image from Gimp, maybe there are an option to set the get the right jpg format?

Test on Ubuntu

python3 ../gdal2tiles-multiprocess.py -l -p raster map.jpg tiles
Generating Base Tiles:
Generating Overview Tiles:

Compressed version with the same issue
map2.zip

Edit
I tested

python3 ../gdal2tiles.py -l -p raster map2.jpg tiles
Generating Base Tiles:
ERROR 6: Reading this image would require libjpeg to allocate at least 3774873600 bytes. This is disabled since above the 104857600 threshold. You may override this restriction by defining the GDAL_ALLOW_LARGE_LIBJPEG_MEM_ALLOC environment variable, or recompile GDAL by defining the GDAL_LIBJPEG_LARGEST_MEM_ALLOC macro to a value greater than 104857600
ERROR 1: map2.jpg, band 1: IReadBlock failed at X offset 0, Y offset 0: Reading this image would require libjpeg to allocate at least 3774873600 bytes. This is disabled since above the 104857600 threshold. You may override this restriction by defining the GDAL_ALLOW_LARGE_LIBJPEG_MEM_ALLOC environment variable, or recompile GDAL by defining the GDAL_LIBJPEG_LARGEST_MEM_ALLOC macro to a value greater than 104857600

I tried to add GDAL_ALLOW_LARGE_LIBJPEG_MEM_ALLOC=yes as an env variable but no success

Hi @SteeveGL , Thanks for sharing.

Here I get the same if using

$ GDAL_ALLOW_LARGE_LIBJPEG_MEM_ALLOC=1 python3 gdal2tiles.py -l -p raster -w none map2.jpg tiles
Generating Base Tiles:
ERROR 1: libjpeg: Backing store not supported
ERROR 1: map2.jpg, band 1: IReadBlock failed at X offset 0, Y offset 0: libjpeg: Backing store not supported

It looks that there is some memory limity if using jpg images.
GDAL usually is designed to work with GeoTIFF images.
So I converted your image from jpg to tiff (no compression applied).
Running the script with the tiff image again was without any problems.

$ GDAL_ALLOW_LARGE_LIBJPEG_MEM_ALLOC=1 python3 gdal2tiles.py -l -p raster -w none map2.tiff tiles

Thanks for you reply, that helped me.

I didn't be able to export to tiff from GIMP, image too big for tiff error. But I exported to jpg, then to tiff and it worked.

thanks