Page 1 of 1

Why doesn't this script work?

Posted: 2010-11-08T14:46:54-07:00
by Cymro
I am new to this and based on the examples I have written this script.


use Image::Magick;
$image=Image::Magick->new;
$image=Image::Magick->new(size=>'640x480');
$text = 'Works like magick!';

$image->Annotate(font=>'kai.ttf', pointsize=>40, fill=>'green', text=>$text);
print "about to write\n";
$image->Write("output.png");
print "after writing\n"


It produces this output.

about to write
after writing

BUT NO IMAGE in the directory.

There are no error messages. I am running it under Ubuntu Linux

Re: Why doesn't this script work?

Posted: 2010-11-08T17:55:06-07:00
by magick
You need to create an image canvas with
  • $image->read('xc:red');
Don't forget to check any exceptions returned by PerlMagick methods.