Here's my test code (it produces "Error: " for me):
Code: Select all
$magick_wand=NewMagickWand();
MagickReadImage($magick_wand,$_POST[image_loc]);
$drawing_wand=NewDrawingWand();
if (!file_exists(FONT_PATH.$_POST[font].'.ttf') || !is_readable(FONT_PATH.$_POST[font].'.ttf'))
{
echo "Font File Error (".FONT_PATH.$_POST[font].'.ttf'.")";
die();
}
DrawSetFont($drawing_wand,FONT_PATH.$_POST[font].'.ttf');
DrawSetFontSize($drawing_wand,20);
DrawSetGravity($drawing_wand,MW_CenterGravity);
$pixel_wand=NewPixelWand();
PixelSetColor($pixel_wand,"black");
DrawSetFillColor($drawing_wand,$pixel_wand);
$result = MagickAnnotateImage($magick_wand,$drawing_wand,0,0,0,"Banana");
if(!$result || $result == 0)
{
echo 'Error: '.MagickGetExceptionString($magick_wand);
die();
}
header( 'Content-Type: image/gif' );
MagickEchoImageBlob( $magick_wand );