> On Sat, 17 Aug 2002, T&C Winquist wrote:
>
> > 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.
> >

Don't know much about PerlMagick ... but a couple of things to think about.

Why does it complain about writing to file, when you're not trying to do
that ? (Afaik, you're trying to write to stdout.)

Also, I would expect that stdout would have to be binmoded if you're going
to write the file to there.

Hth

Cheers,
Rob

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

Reply via email to