I'm having some problems outputting the results of Image::Magick to a web browser. I can output to a file and it works just fine, but for some reason I get the following error when trying to output to a browser window. My code follows.
my $self = shift;
my $q = $self->query();
my $image_path = $q->param('image');
my $image = Image::Magick->new();
$x = $image->Read(filename =>"/images/users/$image_path");
$x = $image->Resize(geometry =>'175x275');
# THIS DOES NOT WORK - WHY?
$x = $image->Write(.png:-');
# THIS WORKS PERFECTLY:
# $x = $image->Write(filename =>'/images/users/resize/test.png');
The image “http://phoenix/foo.pl?rm=th_show_user;image=481_img-home2.j
+pg” cannot be displayed, because it contains errors.