Hi BMaximus,
You want to use BlobToImage(), like this: my $image=Image::Magick->new(magick=>'gif');
$image->BlobToImage($blobdata);
You probably want to check that what you have *really is* a gif before you do anything with it though, otherwise ImageMagick will crash fairly horribly.
Also have a look at ImageToBlob() (does the obvious).
Docs are here: http://www.imagemagick.org/www/perl.html#blobs
Oh, and if you're using if for the web, it's probably good to have a cacheing proxy in front of it, if it's going to see much use, since ImageMagick is not all that nippy. We use Squid.
andy.
Update: I don't know why I assumed it was a gif. If the image could be more than one format, you could presumably call Image::Magick->new() without parameters, load the blob and use Image::Magick itself to detect the format. I haven't tried this though.
|