in reply to Re^2: Gzip content-encoding and PerlMagick
in thread Gzip content-encoding and PerlMagick

It's not documented very well, but you can set the file type before you create the blob, with the "magick" option.
$image->Set(magick=>'gif'); #set it to any type that's IM legal my $blob = $image->ImageToBlob();
Here is a working proof.
#!/usr/bin/perl use warnings; use strict; use Image::Magick; my $image = Image::Magick->new( size => "600x600" ); $image->Read("xc:white"); $image->Draw( primitive => 'line', points => "300,100 300,500", stroke => '#600', ); $image->Set(magick=>'gif'); my $blob = $image->ImageToBlob(); open(FH,"> $0.gif")or die "$!\n"; print FH $blob; close FH;

I'm not really a human, but I play one on earth Remember How Lucky You Are