Hi, I've been trying for hours to print string variables with imagemagick to make dvd buttons from a shell script. The basic command is:-
Code:
~$ convert -size 720x480 xc:transparent -fill red +antialias -pointsize 48 -draw 'text 100,100 "Button"' image.png
Now to print a string variable I have been using:-
Code:
~$ string=Button
~$ convert -size 720x480 xc:transparent -fill red +antialias -pointsize 48  -draw 'text 100,100 '"$string"' image.png
However try as I might, when the string has spaces, as in:-
Code:
~$ string="Button One"
~$ convert -size 720x480 xc:transparent -fill red +antialias -pointsize 48 -draw 'text 100,100 '"$string" image.png
Imagemagick strips off the quotes and I get an error:-
Code:
convert: Non-conforming drawing primitive definition `One' @ draw.c/DrawImage/3140.
Does anyone know a trick to escape the spaces?




Secret to a long life - Don't forget to breathe.