wil has asked for the wisdom of the Perl Monks concerning the following question:
Hi
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.
- wil
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.
Error:my $self = shift; my $q = $self->query(); my $image_path = $q->param('image'); $self->header_props ( -type =>'image/png', ); my ($image,$x); my $image = Image::Magick->new(); $x = $image->Read(filename =>"/images/users/$image_path"); $x = $image->Resize(geometry =>'175x275'); # THIS DOES NOT WORK - WHY? binmode STDOUT; $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.
- wil
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Image::Magick and outputting to browser
by arthas (Hermit) on May 21, 2003 at 14:37 UTC | |
•Re: Image::Magick and outputting to browser
by merlyn (Sage) on May 21, 2003 at 19:24 UTC | |
Re: Image::Magick and outputting to browser
by Hagbone (Monk) on May 21, 2003 at 22:17 UTC | |
Re: Image::Magick and outputting to browser
by glwtta (Hermit) on May 21, 2003 at 20:13 UTC | |
by thraxil (Prior) on May 22, 2003 at 15:39 UTC |
Back to
Seekers of Perl Wisdom