Choose File Location When Converting Image Size

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

Posts: 1
Joined: Fri May 29, 2015 11:52 pm

Choose File Location When Converting Image Size

Post by jandro »

Does anyone know how to choose the output location of an image when converting its size? I've tried adding the folder location to the command but it doesn't seem to work. This is the command that i'm using (Straight from the tutorial)

nconvert -out png -resize 510 230 *.jpeg

Any suggestions would be great. Thank you!
User avatar
Moderator & Librarian
Posts: 6352
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Choose File Location When Converting Image Size

Post by XnTriq »

Mango Juice ([url=]bugs and suggestions for NConvert[/url]) wrote:
mrQQ wrote:and second, it would be really great to have an option to specify output path..
mrQQ: try using the -o parameter!

so: -o c:\downloads\filename.jpg
or: -o c:\downloads\%.jpg - if you're doing multiple files - % will become the source file name minus extension

Remember to use %% if you're running it out of a batch file.
Posts: 1
Joined: Tue Jun 23, 2015 9:01 pm

Re: Choose File Location When Converting Image Size

Post by ghiebert »

I just downloaded ncovert.exe today from here, so can I assume it is the latest?

To resize multiple tif's to 1000px longest dimension, keeping the aspect ratio, convert to jpeg and then save the files to a different directory, this worked for me:
Start directory: f:\5DMkII
Destination directory: f:\test

nconvert.exe -out jpeg -ratio -resize longest 1000 -o f:\test\% f:\5DMkII\*.tif

The % means the filename. It would have been better if they had used something more obvious like {filename} because when you are scripting % can mean a lot of various things.
I guess I could have put -dpi 72 in there for web images
Note: You cannot place the -o parameter at the end of the line after the source directory name, as one intuitively might think to do.