VoidVolker / MagickSlicer

Map tiles generator
MIT License
84 stars 27 forks source link

Dream - Support GDAL tools #12

Open ambs opened 6 years ago

ambs commented 6 years ago

Unfortunately image magick does not work when a dimension is larger than 30000 pixels. GDAL tools seem to support bigger raster files, but the interface is different from convert. I am trying to understand how can I tweak your great script to use them. Cheers!

EDIT: I have portions of the script working with gdalinfo and gdal_translate. But they are tuned for my standard use case, and would need work for other cases. Anyway, would be happy to share them.

http://eremita.di.uminho.pt/~ambs/panoramics/0013-vez/index.html

VoidVolker commented 6 years ago

Hi! Image magick does work with big images. I have converted successfully image with size 19469x5000.

ambs commented 6 years ago

Sorry, it was a typo. More than 30K width.

VoidVolker commented 6 years ago

Sorry, more 30k requires changes in script - looks like issue in 32 bit calculations in shell math. May be in some modern shell versions it can works.

ambs commented 6 years ago

Not sure how shell math is handling it. But swapping from imagemagick to gdal_translate was enough for now.

0033-vila_nova_milfontes/image.jpg JPEG 32327x2796 32327x2796+0+0 8-bit sRGB 15.74MB 0.000u 0:00.000

Result here: http://eremita.di.uminho.pt/~ambs/panoramics/0033-vila_nova_milfontes/index.html But yes, this one is still bellow the (2^16)/2 limit. But in the other hand, shell math looks good:

echo $((30000 + 30000 * 2)) 90000

Best

VoidVolker commented 6 years ago

Hm, maybe. There in code image sizes is multiply to get more accurate sizes for new images. Right now I don't remember details, sorry - need deep script debug.

ambs commented 6 years ago

No stress. For me, for now, all working good. Just though it would be nice to share.

VoidVolker commented 6 years ago

Thank you! Can you share code parts for GDAL tools? I'll add it to script.

ambs commented 6 years ago

I do not have everything working. Here goes my current script. -- https://gist.github.com/ambs/0c55e775ed27584e2d798017e8d7babc

Note that GDAL tools does not like small files, so this script uses gdal tools in some places, and image magick in others. Also, the tile funcionality from imagemagick is not available, thus I needed to create two loops and crop manually the image.

Cheers