Page 1 of 1

TIFF image won't annotate unless it is ridiculously small. H

Posted: 2007-02-09T12:54:52-07:00
by broomballboy
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.

Help.
-Andy

Code: Select all


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);

Re: TIFF image won't annotate unless it is ridiculously small. H

Posted: 2007-02-09T13:11:08-07:00
by magick
We could not reproduce the problem. We used your script to annotate images up to 2MB and 2500x2500 in size. We're using ImageMagick 6.3.2-4.

Re: TIFF image won't annotate unless it is ridiculously small. H

Posted: 2007-02-09T13:27:58-07:00
by broomballboy
Thanks for the reply. This is day 3 of banging at this with no success.

I am using ImageMagick 6.3.2 with release date 1/31/2007.

I have ActivePerl 5.8.3.809 on a windows server.

and the latest PerlMagick from the website.

A 120k image that will not work can be found here.

http://www.broomballboy.com/images/120.tif

Re: TIFF image won't annotate unless it is ridiculously small. H

Posted: 2007-02-09T14:34:06-07:00
by magick
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.