Reputation: 9184
I must to convert about billion of images from jp2 to jpg...
I create such .bat
for /d %%d in (*) do (
for %%f in ("%%~d\*.jp2") do (
convert -limit memory 0 -limit map 0 "%%~ff" -quality 25 "%%~dpf\jpg\%%~nf.jpg"
)
)
but when it convert's over ~ 100 000 windows throw's me error's with free memory etc... How can i do that memory is used more humanity? So that imageconverter? if yes then release that memory.... Maybe there are ways to thread this ot something else?
Now i get in concolse free memory error's and also window's throw erro's too...
Also if i delete limit memory 0 -limit map 0 i have the same problem...
Upvotes: 1
Views: 483
Reputation: 24466
Per our chat session, the solution is not to use ImageMagick's convert
for the conversion. IrfanView supports command line switches for batch processing, and works well using wildcards both in source and destination arguments. You'll also need the jpeg2000 plugin to convert from jp2.
for /d %%d in (*) do (
pushd "%%d"
if not exist "jpg\" md jpg
"c:\Program Files (x86)\IrfanView\i_view32.exe" *.jp2 /convert=jpg\*.jpg /jpgq=25
popd
)
Upvotes: 1