Error with using Imagemagick convert from a shell script
am 03.10.2007 08:16:05 von samir
Hello,
I have the following part in a shell script.
export TextToPrint="Does this print"
textString=`echo "'text 100,250 \"$TextToPrint\"'"`
echo $textString
echo convert -font helvetica -fill black -pointsize 36 -draw
$textString temp1/$filename temp1/$filename.new.jpg
convert -font helvetica -fill black -pointsize 36 -draw $textString
temp1/$filename temp1/$filename.new.jpg
Output
-----------
'text 100,250 "Does this print"'
convert -font helvetica -fill black -pointsize 36 -draw 'text 100,250
"Does this print"' temp1/000.jpg temp1/000.jpg.new.jpg
convert: Non-conforming drawing primitive definition `text'.
....
surprisingly,
if I copy the echoed convert command from this output and paste it
onto the shell prompt and execute it independently ...it works !!
but, it does not seem to work from the shell script...
any idea/help on this would be greatly appreciated..
samir
Re: Error with using Imagemagick convert from a shell script
am 03.10.2007 12:34:12 von ramesh.thangamani
On Oct 3, 11:16 am, Samir wrote:
> Hello,
> I have the following part in a shell script.
>
> export TextToPrint="Does this print"
> textString=`echo "'text 100,250 \"$TextToPrint\"'"`
> echo $textString
> echo convert -font helvetica -fill black -pointsize 36 -draw
> $textString temp1/$filename temp1/$filename.new.jpg
> convert -font helvetica -fill black -pointsize 36 -draw $textString
> temp1/$filename temp1/$filename.new.jpg
>
> Output
> -----------
> 'text 100,250 "Does this print"'
> convert -font helvetica -fill black -pointsize 36 -draw 'text 100,250
> "Does this print"' temp1/000.jpg temp1/000.jpg.new.jpg
> convert: Non-conforming drawing primitive definition `text'.
>
> ...
> surprisingly,
> if I copy the echoed convert command from this output and paste it
> onto the shell prompt and execute it independently ...it works !!
> but, it does not seem to work from the shell script...
>
> any idea/help on this would be greatly appreciated..
> samir
Hi Samir i tried in the file as follows.
It works fine for me. Or your issue is something else?
1 #! /bin/sh
2
3 export TextToPrint="Does this print"
4 textString=`echo "'text 100,250 \"$TextToPrint\"'"`
5 echo $textString
6 echo convert -font helvetica -fill black -pointsize 36 -draw \
7 $textString temp1/$filename temp1/$filename.new.jpg \
8 convert -font helvetica -fill black -pointsize 36 -draw
$textString \
9 temp1/$filename temp1/$filename.new.jpg