Error output folder name

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

Moderators: XnTriq, helmut, xnview

Post Reply
kosho
Posts: 3
Joined: Thu Oct 29, 2009 2:26 pm

Error output folder name

Post by kosho »

Hello,

With the command :

Code: Select all

nconvert -o "C:\#test\jpg\7V1A3881.JPG" -out jpeg -resize 1920 1280  -opthuff -q 90 -i "C:\#test\7V1A3881.JPG"
the result :
Conversion of C:\#test\7V1A3881.JPG into C:\1test\jpg\7V1A3881.JPG OK

Why the output folder is changed to C:\1test?
cday
XnThusiast
Posts: 3973
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Error output folder name

Post by cday »

kosho wrote:With the command :

Code: Select all

nconvert -o "C:\#test\jpg\7V1A3881.JPG" -out jpeg -resize 1920 1280  -opthuff -q 90 -i "C:\#test\7V1A3881.JPG"
the result :

Conversion of C:\#test\7V1A3881.JPG into C:\1test\jpg\7V1A3881.JPG OK

Why the output folder is changed to C:\1test?
In the NConvert help file '#' is defined as a numeric enumerator:

Code: Select all

Options :
...
-o filename       : Output filename
              Use # to specify position of numeric enumerator
              Use % to specify source filename
              Use $ to specify full source pathname
              Use $$ to specify source folder name
I don't know if there is a way to 'escape' that interpretation, but doubling as required to escape some characters in a Windows batch file would be interpreted as a two-character numeric enumerator...

Edit -- Two possibly relevant posts:

Re: output to folders with "#"

Filenames with % character

I don't know if the proposal in the first was implemented, and the second suggests that it might be worth trying '##' contrary to my thought above?

Does anyone know if '#' can be escaped when used in an output file name?
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Error output folder name

Post by xnview »

if i add $# to escape #??
Pierre.
cday
XnThusiast
Posts: 3973
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Error output folder name

Post by cday »

xnview wrote:if i add $# to escape #??
Whatever you think would be best... :D

I don't know if there are any conventions for escape characters; a character that would be unlikely to be used in a file name might be a good choice (such as ^ or ~ perhaps?) or even a character that would be illegal in a (Windows) filename such as '>' if that is technically possible??

Consistentcy with any other escape use cases in NConvert would be desirable.

Other suggestions welcome...
cday
XnThusiast
Posts: 3973
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Error output folder name

Post by cday »

As '#' is a numeric enumerator that may, if I understand correctly, be included in code as '#' '##' '###' etc, any escape notation should if possible work for any representation...

As for the escape notation to be used, that is really outside my experience (I never expected even to use the command line... :wink: ) but I have presented some thoughts above that may or may not make sense.
kosho
Posts: 3
Joined: Thu Oct 29, 2009 2:26 pm

Re: Error output folder name

Post by kosho »

It worked in version :
** NCONVERT v5.50 (c) 1991-2009 Pierre-E Gougelet (Sep 16 2009/15:20:46) **

And it is replace # with 1 when I tried the new version.
# is a numeric enumerator for file name, not for folder.
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Error output folder name

Post by xnview »

kosho wrote: And it is replace # with 1 when I tried the new version.
# is a numeric enumerator for file name, not for folder.
i've added $# for next version. But is it needed to have # for folder name??
Pierre.
gautxori
Posts: 8
Joined: Sun Oct 07, 2007 10:48 pm

Re: Error output folder name

Post by gautxori »

Can xnview make a note of this in nconvert help?
Post Reply