Mogrify not working on batch
Posted: 2017-09-13T11:40:12-07:00
Hey all!
I am trying to create a batch file that process all jpgs in multiple subdirectories of certain folder.
It looks like this:
if I use mogrify -trim, it works perfectly. But as soon as I try to add the -fuzz 30%, it throughts the following error:
This code works perfectly, is the added -fuzz 30% that breaks it.
I also tried this on cmd and work perfectly:
Best regards!
I am trying to create a batch file that process all jpgs in multiple subdirectories of certain folder.
It looks like this:
Code: Select all
cd C:\codigo2\
for /r /d %%a in (*) do mogrify -fuzz 30% -trim "%%~a\*.jpg"
pause
for /r /d %%a in (*) do mogrify -resize 1000x5000 "%%~a\*.jpg"
for /r /d %%a in (*) do mogrify -gravity center -extent 1115x5000 "%%~a\*.jpg"
pause
Do you know how to tell windows I am trying to pass multiple parameters with hyphens?The following usage of the path operator in batch-parameter substitution is invalid: %~a*.jpg"
This code works perfectly, is the added -fuzz 30% that breaks it.
Code: Select all
cd C:\codigo2\
for /r /d %%a in (*) do mogrify -trim "%%~a\*.jpg"
pause
for /r /d %%a in (*) do mogrify -resize 1000x5000 "%%~a\*.jpg"
for /r /d %%a in (*) do mogrify -gravity center -extent 1115x5000 "%%~a\*.jpg"
pause
Code: Select all
mogrify -fuzz 30% -trim "image.jpg"
Best regards!