Adding text does not work

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

Moderators: XnTriq, xnview

User avatar
Peter2
XnThusiast
Posts: 1104
Joined: Thu Nov 24, 2005 3:07 pm
Location: CH

Adding text does not work

Postby Peter2 » Thu Oct 25, 2012 3:18 pm

I used XnConvert to create the code to adding a text. This was the result:

Code: Select all

nconvert -text_font Arial -text_color 0 0 0 -text_back 0 0 0 -text_flag top-left -text_pos 500 400 -text_rotation 0 -text "sdfefhrfghrfh
fhgfhfg
dghfdgh"


Then I removed the linefeed and added input and output:

Code: Select all

nconvert -text_font Arial -text_color 0 0 0 -text_back 0 0 0 -text_flag top-left -text_pos 500 400 -text_rotation 0 -text "sdfefhrfghrfh" -o y.tif x.tif


The result was that it created "x_1.tif" and a lot of errors:

Code: Select all

Error: Can't open file (0)
Error: Can't open file (0)
Error: Can't open file (0)
Error: Can't open file (-text_back)
Error: ....


What is wrong?
(Current nconvert 6.21)

Peter
XnView 2.42 German, Win 7 x64 Prof. / Win 10

User avatar
Peter2
XnThusiast
Posts: 1104
Joined: Thu Nov 24, 2005 3:07 pm
Location: CH

Re: Adding text does not work

Postby Peter2 » Thu Oct 25, 2012 3:47 pm

First progress:
It seem to depend on the font size. The help says:

Code: Select all

          -text_font name size  : Font name and size

Now I used:

Code: Select all

nconvert -quiet -rotate 90 -text "hallo" -text_font Arial 5 -out tiff -c 7 -o y.tif x.tif

It puts the text in the upper-left corner, but "size 5" or "50" or "500" - the result is the same; only a few pixels high.

Then I continued:

Code: Select all

nconvert -quiet -rotate 90 -text "hallo" -text_font Arial 5 -text_flag bottom-left -out tiff -c 7 -o y.tif x.tif

-> The text stays in the upper-left corner.

Peter
XnView 2.42 German, Win 7 x64 Prof. / Win 10

User avatar
xnview
Author of XnView
Posts: 28275
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Adding text does not work

Postby xnview » Fri Oct 26, 2012 12:33 pm

Right for XnConvert, size must be added

Else -text must last command

Code: Select all

nconvert -quiet -rotate 90 -text_font Arial 5 -text_flag bottom-left -text "hallo" -out tiff -c 7 -o y.tif x.tif
Pierre.

User avatar
Peter2
XnThusiast
Posts: 1104
Joined: Thu Nov 24, 2005 3:07 pm
Location: CH

Re: Adding text does not work

Postby Peter2 » Fri Oct 26, 2012 12:56 pm

xnview wrote:Right for XnConvert, size must be added

So the export from XnConvert is wrong.

xnview wrote:Else -text must last command

Thanks. Please add to the "-help command" in nconvert.

Peter
XnView 2.42 German, Win 7 x64 Prof. / Win 10


Return to “NConvert”

Who is online

Users browsing this forum: No registered users and 1 guest