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');