> Hello all,
>
> I am trying to use Image::Magick to resize a JPEG. This routine works to
> display the full size image from a blob in my Firebird database:
>
> while ( my ($PixData )
> = $sth->fetchrow ) {
> print header('image/jpeg');
> print $PixData;
> }
>
> But when I add the Image::Magick stuff:
>
> while ( my (@PixData) = $sth->fetchrow) {
> my $PixDisp=Image::Magick->new(magick=>'jpg');
> $PixDisp->BlobToImage(@PixData);
> $PixDisp->Resize(geometry=>'160x120');
> print header('image/jpeg');
> print $PixDisp;
> }
>
> I get this:
> Image::Magick=ARRAY(0x82fdee8)
> instead of an image. Can anyone see my obvious mistake?
>
You are getting this because $PixDisp holds an Image::Magick object
which can't be stringified as you desire. You need to (it appears) call
the 'Write' method of the object to have it converted to image data.
http://www.ImageMagick.org/www/perl.html
Check the above for an example of how to print an image to a filehandle,
in your case you want the default STDOUT....
HTH,
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>