I have been using what has worked in the past, but am open to a "proper" way to write and image.
example code runs in command prompt under perl.exe and from browser request through IIS as type .pl mapped to perl.exe.
A problem occurs when run from a browser as type .plx mapped to perlis.dll
example runs as expected under IM 6.2.9.7 and earlier. I can not get any versions 6.2.9.8 or later to work with perlis.dll
I have been using what has worked in the past, but welcome any suggestion for a "proper" way to write and image.
Code: Select all
#!c:/perl/bin/perl.exe
use Image::Magick;
$image=Image::Magick->new;
$error=$image->Set(size=>'200x200');
die "$error" if "$error";
$error=$image->ReadImage('xc:white');
die "$error" if "$error";
$x=100; $y=100;
$r=50; $xr=$x+$r;
$error=$image->Draw(stroke=>'#004444', primitive=>'circle',
fill=>'skyblue',
points=>"$x,$y,$xr,$y",strokewidth=>8);
die "$error" if "$error";
$error=$image->Draw(stroke=>'red', primitive=>'rectangle',
points=>'20,20 100,100',strokewidth=>5);
die "$error" if "$error";
@blobs = $image->ImageToBlob(magick=>'png');
use CGI qw(:standard -nph);
print header('image/png');
print $blobs[0];
Code: Select all
Content-type: text/html
'D:\InetPub\WWWRoot\WIS\PerlSupport\demo.plx' script produced no output
Code: Select all
Content-type: image/png â°PNG IHDRÃÃÂX®ž.... lot of binary looking stuff.