I have a folder full of .jpg files that I would like to convert to .jp2 (jpeg 2000)
I tried a batch file like below but it's not working. I run the batch file in the same folder with the .jpg image files. Any help would be greatly appreciated.
===========================================
SETLOCAL EnableDelayedExpansion
SET CONVERT="%PROGRAMFILES%\ImageMagick\Convert"
...
for %%b in (*.jpg) do convert JP2: %%b %%~nb.jp2
batch convert a folder full of .jpg files to .jp2
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: batch convert a folder full of .jpg files to .jp2
That isn't valid convert syntax. The following is:convert JP2: %%b %%~nb.jp2
Code: Select all
convert %%b %%~nb.jp2
snibgo's IM pages: im.snibgo.com
-
- Posts: 59
- Joined: 2009-01-30T03:46:08-07:00
Re: batch convert a folder full of .jpg files to .jp2
Code: Select all
@echo off
SETLOCAL
SET workdir=%~0
FOR /F %%A IN ('dir %workdir%\*.jpg /B /ON /A-D') DO (
convert "%workdir%\%%A" "%workdir%\%%~nA.jp2"
)