I'm running the following code as a .bat file, to crop my images which range from 10000x10000 up to 20000x30000 px.
Code: Select all
for %%f in (*.jpg) do (
convert %%f -crop 500x500 -set filename:tile "%%t_%%[fx:page.y/500+1]_%%[fx:page.x/500+1]" slices\%%[filename:tile].jpg
)
I'm not sure whether it is related but the problems started after I tried to incorporate the above script in a .bat which creates the necessary subdirectories for all my image folders:
Code: Select all
setlocal
set "location=D:\Reg\B\N1"
for /d %%d in ("%location%\*") do (
md "%%d\slices"
)
for %%f in (*.jpg) do (
convert %%f -crop 500x500 -set filename:tile "%%t_%%[fx:page.y/500+1]_%%[fx:page.x/500+1]" slices\%%[filename:tile].jpg
)