I'm using ImageMagick version 5.4.9 (I installed PerlMagick WITH
ImageMagick), ActiveState ActivePerl version 5.6 on Win2k Adv Server running
IIS 5.0.  I'm trying to display an image using PerlMagick directly to a web
browser (without saving the image to a file first).

The strange thing is that the perl script prints out the header and image
just fine from a COMMAND PROMPT.  However, calling the script from a web
browser gives me the error "Exception 425: An error has occurred writing to
file (-)"  It WILL let me save the image to a file (from the web), it just
won't let me 'pipe' the image straight to the browser.  It's almost like
it's a permissions issue.  I have given 'Everyone' full rights to the
directory where I opened the image from and where I'm calling the script
from, but that didn't help either.  Like I said, it works from a command
prompt, but not from the web.  I thought that maybe IIS has a problem
finding the ImageMagick DLL's.  However, the only problem with the script is
the fact that it doesn't like writing the file to 'gif:-'.  Very strange!  I
don't know what to do.  Anyone else have this problem using ImageMagick on
Win2k and had been able to find the fix??


Here is my Perl script:

#!c:\perl -w

use Image::Magick;
use FileHandle;

my $filename = "z:/web/x.gif";
my $image = Image::Magick->new();
$image->Read($filename );
$image->Crop(geometry=>"400x400+500+400");
autoflush STDOUT 1;
print ("Content-type: image/gif\r\n\r\n");

$last_error = $image->Write('gif:-');
if($last_error){print ($last_error);}

undef $image;

1;

exit;

I've been told by other sources that there is nothing wrong with the script.

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to