You want to use BlobToImage(), like this:
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.my $image=Image::Magick->new(magick=>'gif'); $image->BlobToImage($blobdata);
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.
In reply to Re: Image::Magick and reading images from variables.
by andye
in thread Image::Magick and reading images from variables.
by BMaximus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |