PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Hi I have code to annotate a tiff and write the new image. It works fine for tiff files less that about 100k in size. If I use a larger tiff the new tiff file is written but the annotation never occurs.
use Image::Magick;
use CGI;
my $query = new CGI; # create new CGI object
my $text = ($query->param("text") or "BLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAH");
my $file = ($query->param("File") or "watermark/p1.tif");
$image=Image::Magick->new(magick=>'tif'); works.a
$x=$image->ReadImage($file);
warn "$x" if "$x";
$image->Annotate(text=>$text,font=>'@c:/winnt/fonts/arial.ttf',pen=>'blue', rotate=>-45, style=>'Italic', gravity=>'Center',pointsize=>72, antialias=>'true');
$image->Write('watermark/demo.tif');
undef($image);
Your image is quite large (9600x7600) so ImageMagick is probably caching it to disk which is 1000 times slower than in-memory conversion. This most likely is causing a timeout on your HTTP session. For a discussion, see http://magick.imagemagick.org/script/architecture.php.