Specify format of large numbers when used in filenames
Posted: 2013-10-23T18:45:51-07:00
Hello
I use the following script to tile large images into 256x256 chunks, with a tile X and Y in the filename, for use in Google Maps-style maps:
Basically, it resizes the image, cuts it up into 256x256 tiles, then writes the filenames out as "x_y.png". X and Y are calculated from the page x and y using expressions, then a large number is added to each, which positions it in the global map (i.e. the large numbers are necessary).
The problem is, the number can be quite large, so are being converted to string in "e" format, e.g. filenames come out as:
Which should rather be something like:
Is there any way I can tell ImageMagick to format the numbers as plain numbers when converting them to a string?
Thanks
Joel
I use the following script to tile large images into 256x256 chunks, with a tile X and Y in the filename, for use in Google Maps-style maps:
Code: Select all
convert input.png -sample 400% -crop 256x256 -set filename:tile "%[fx:page.x/256.0+1724074]_%[fx:page.y/256.0+1245486]" +repage +adjoin "%[filename:tile].png"
The problem is, the number can be quite large, so are being converted to string in "e" format, e.g. filenames come out as:
Code: Select all
1.72409e+006_1e+008.png
Code: Select all
12345678_12345678.png
Thanks
Joel