At 10:28 AM 01/09/2004, Wiggins d Anconia wrote:


> 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.

D'oh! I C


You need to (it appears) call the 'Write' method of the object to have it converted to image data.

OK


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....

I've been all over that page, but I'm still stuck at how to do what I want. I don't want Apache writing files, I just want to display the new image dynamically. Is that even possible?




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to