Need help Annotating

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
zombie_nation

Need help Annotating

Post by zombie_nation »

Hi guys,

I have managed to create my script to do the following:
upload an image from user
take input text
create a canvas of required width and height (px) at correct density
resize uploaded image and composite
composite the annotated text onto the image
thumbnail the image
and store everything in appropraite directories....

And when I installed and ran the script on my server it .. failed.
The image was created but no text was written on the image.

I tried the following simple command:
/usr/bin/montage -geometry +0+0 -background skyblue -label "Faerie Dragon" /home/mysports/public_html/images/cards/samples/text.jpg /home/mysports/public_html/images/cards/samples/text.jpg

but even this did not work - the sample image is at http://www.mysportscards.org/images/car ... s/text.jpg.
I ran the command using ssh and got the following error:
montage: unable to read font `(null)'

Can anyone point me in the right direction?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Need help Annotating

Post by Bonzo »

I would guess there is something wrong with your instal and ImageMagick can not find a default font. Try adding the path to a known font and see if that works e.g.

Code: Select all

exec("/usr/bin/convert -size 236x130 xc:lightblue -fill black -font verdana.ttf -pointsize 25 -gravity NorthWest -annotate +0+0 \"The quick red fox jumped over the lazy brown dog.\" annotate1.jpg");
This is linking to a verdana.ttf uploaded to the same folder as the code.
Post Reply