Nconvert -o: % has no effect?

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

Moderators: XnTriq, helmut, xnview

Hr.Mansen

Nconvert -o: % has no effect?

Post by Hr.Mansen »

When I convert multiple pictures and concating a name to the result, no name is concatenated. A very simple call could be:
"c:\program files\XnView\nconvert" -o result_%.jpg test.jpg test2.jpg
- this should not change the picture a bit, but just concatenate result_ to the filename but the result is:
Conversion of test.jpg into result_.jpg OK
- and not result_test.jpg...

I have tried a lot of possible ways, but none gave me a result_test.jpg

I find this one a little strange:
"c:\program files\XnView\nconvert" -o c:\test\result_%.jpg c:\test\test.jpg
gives this result:
Error: Can't open file (c:\test\result_\test\test.jpg) :shock:

In the end I would like to do something like this:
"c:\program files\XnView\nconvert" -o c:\test\test_%.gif -truecolours - colours 256 -out gif -ratio -rtype linear -resize 120 120 "c:\test\test.jpg" "c:\test\test2.jpg"

Thanks for a real cool viewer and converter!
Anders Hermansen, Denmark
Hr.Mansen

Post by Hr.Mansen »

Hmm... I should'nt be doing .bat-files, if I did'nt know the syntax :mrgreen:

% is interpreted as a variable of some sort. I think the right way to use them is with a %1 (for the first argument) :)

If one wants a % you should write %%
User avatar
xnview
Author of XnView
Posts: 45224
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post by xnview »

Hr.Mansen wrote:% is interpreted as a variable of some sort. I think the right way to use them is with a %1 (for the first argument) :)
If one wants a % you should write %%
Yes, in a batch file, you must use %%
Regards. Pierre.