Adding text does not work

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

Moderators: helmut, XnTriq, xnview

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

Adding text does not work

Post by Peter2 »

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
XnViewMP <Current version> German, XnConvert <Current version>, Win 10
User avatar
Peter2
XnThusiast
Posts: 1365
Joined: Thu Nov 24, 2005 3:07 pm
Location: CH

Re: Adding text does not work

Post by Peter2 »

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
XnViewMP <Current version> German, XnConvert <Current version>, Win 10
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Adding text does not work

Post by xnview »

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: 1365
Joined: Thu Nov 24, 2005 3:07 pm
Location: CH

Re: Adding text does not work

Post by Peter2 »

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
XnViewMP <Current version> German, XnConvert <Current version>, Win 10
Post Reply