Discussions on NConvert - the command line tool for image conversion and manipulation
Moderators: XnTriq , helmut , xnview
wonzling
Posts: 3 Joined: Wed Jan 06, 2021 4:32 pm
Post
by wonzling » Wed Jan 06, 2021 4:43 pm
Hello, i want to add some text to an foto with this:
Code: Select all
C:\Users\XXXXXX\Desktop\NConvert>nconvert -canvas #1 #500 top-center -bgcolor 255 005 255 -ratio -rtype lanczos -text_font "Arial" 100 -text_color 0 0 0 -text_flag bottom-center -text_pos 0 -400 -text_rotation 0 -text "Hello Test" TEST.jpg
This code works perfect.
Now i want the text under the image in two lines:
Hello
Test
I have tried to export from XNView MP but also this not works ...
Can someone help me?
Thanks
cday
XnThusiast
Posts: 4187 Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.
Post
by cday » Wed Jan 06, 2021 5:46 pm
The problem, ignoring all the other details, is how to use the -text option to insert two lines of text, if that is actually possible?
In XnView MP Batch convert (or XnConvert) pressing the 'Enter' key creates a second text line in the image preview, and the exported code has a line break at that point, have you tested what happens if you put a line break in your code, quite possibly nothing?
If a line break in the code doesn't work, I'm not sure whether there is any other character that might be recognised as a line break?
If those possibilities don't work, my only immediate suggestion would be to write the two lines in separate lines of code.
cday
XnThusiast
Posts: 4187 Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.
Post
by cday » Wed Jan 06, 2021 7:51 pm
Update:
I've now tested with a line break ('Enter') in the code line, and not surprisingly the code doesn't run.
So the only solution would seem to be to use two lines of code, to write first one line of text, then the second one below.
@Pierre : Is there any way to write two lines of text using one line of code, to force a new line?
Text_1
Text_2
wonzling
Posts: 3 Joined: Wed Jan 06, 2021 4:32 pm
Post
by wonzling » Thu Jan 07, 2021 10:47 am
cday wrote: ↑ Wed Jan 06, 2021 7:51 pm
Update:
I've now tested with a line break ('Enter') in the code line, and not surprisingly the code doesn't run.
So the only solution would seem to be to use two lines of code, to write first one line of text, then the second one below.
@Pierre : Is there any way to write two lines of text using one line of code, to force a new line?
Text_1
Text_2
thank you for your reply. Also I have only the Idea with two lines of code ... But if @Piere have an solution ...
xnview
Author of XnView
Posts: 44922 Joined: Mon Oct 13, 2003 7:31 am
Location: France
Post
by xnview » Fri Jan 08, 2021 10:11 am
wonzling wrote: ↑ Thu Jan 07, 2021 10:47 am
thank you for your reply. Also I have only the Idea with two lines of code ... But if @Piere have an solution ...
No, but i'll add in next version \n as new line character...
Pierre.
wonzling
Posts: 3 Joined: Wed Jan 06, 2021 4:32 pm
Post
by wonzling » Fri Jan 08, 2021 4:39 pm
@Piere. OK thank you.
A suggestion: start nconvert with the XBS from XNVIEW MP. This would be nice.
Like:
nconvert -Test.xbs
xnview
Author of XnView
Posts: 44922 Joined: Mon Oct 13, 2003 7:31 am
Location: France
Post
by xnview » Sat Jan 09, 2021 7:39 am
wonzling wrote: ↑ Fri Jan 08, 2021 4:39 pm
@Piere. OK thank you.
A suggestion: start nconvert with the XBS from XNVIEW MP. This would be nice.
Like:
nconvert -Test.xbs
And what about xnconvert test.xbs?
Pierre.
Peter2
XnThusiast
Posts: 1350 Joined: Thu Nov 24, 2005 3:07 pm
Location: CH
Post
by Peter2 » Wed Jan 13, 2021 8:44 am
xnview wrote: ↑ Fri Jan 08, 2021 10:11 am
No, but i'll add in next version \n as new line character...
Fine - I'm just looking for it too.
@Xnview:
Do you already know when you will release the next version?
XnViewMP <Current version> German, XnConvert <Current version>, Win 10
Peter2
XnThusiast
Posts: 1350 Joined: Thu Nov 24, 2005 3:07 pm
Location: CH
Post
by Peter2 » Wed Mar 10, 2021 5:23 pm
See in version 2.49.5, Feb 02, 2021
XnViewMP <Current version> German, XnConvert <Current version>, Win 10
Peter2
XnThusiast
Posts: 1350 Joined: Thu Nov 24, 2005 3:07 pm
Location: CH
Post
by Peter2 » Mon Apr 19, 2021 2:59 pm
xnview wrote: ↑ Fri Jan 08, 2021 10:11 am
No, but i'll add in next version \n as new line character...
@Pierre
please add this info also to the "-help" section.
XnViewMP <Current version> German, XnConvert <Current version>, Win 10