Page 1 of 1
How to add text 1\'/" on a picture
Posted: 2007-10-28T21:02:20-07:00
by jueljust
I wanna place text
1\'/" on a picture
then i input the follow command in shell
Code: Select all
convert -fill red -font /arial.ttf -pointsize 30 -draw "text 50, 150 '1\\\'/\"' " /src.jpg /dist.jpg
then i got an error message
Code: Select all
convert: Non-conforming drawing primitive definition `/'.
and text
1\ was placed on the dist.jpg
please told me how to add this text, and what's my problem
regards
Re: How to add text 1\'/" on a picture
Posted: 2007-11-15T21:14:13-07:00
by anthony
You are dealing with quotes within quotes within a shell.
This in turn make it very difficult to determine the number of backslashes needed.
As you used double quotes for the argument the shell will remove all backslashes as part of its escape mechanism unless they are doubled.
Further more regarless of the internal quotes used, IM -draw will also escape (and remove) baclshashes that are not doubled.
That is you need to double then quadruple a backslash to get one single backslash.
you have a few options. first, don't use -draw. use -annotate That only has a single quote system, so you only need to handle shell escaping. next if you don't need to substitute shell variables into the argument, use single quotes. That will eliminate the shell escaping mechanism.
For more details see IM Examples, To Quote or Backslash?
http://imagemagick.org/Usage/draw/#quote
Re: How to add text 1\'/" on a picture
Posted: 2007-11-27T09:05:39-07:00
by jueljust
thank you so much, it very helpful!