As I'm trying to use nconvert within a btach file under windows, I'm facing a problem using relative paths.
Here it is :
Initial directory structure
Code: Select all
- originals
- family
- doe
file.jpg
- smith
- friends
- web
So I use this commande line in a batch file :
Code: Select all
for /f %%I in ('forfiles /s /m *.* /c "cmd /c echo @relpath"') do nconvert -ratio -rtype lanczos -rflag decr -rflag orient -resize 1920 1200 %%~I -o "..\web\%%~I"
Code: Select all
Error : Can't open file (-o)
Error : can't open file (..\web\.\family\doe\file.jpg)
Code: Select all
nconvert -ratio -rtype lanczos -rflag decr -rflag orient -resize 1920 1200 .\family\doe\file.jpg -o "..\web\.\family\doe\file.jpg"
Thanks in advance