my $image = Image::Magick->new; open(IMAGE,"$path") or upload_failed("Couldn't open $path for reading",$path); $image->Read(file=>*IMAGE); close(IMAGE); $image->Resize(width=>$conf->thumb_width,height=>$conf->thumb_height); open(THUMB,">$thumbs/thumb_$filename") or upload_failed("Couldn't open thumbnail file: $!",$path); $image->Write(file=>*THUMB,filename=>"$thumbs/thumb_$filename"); close(THUMB); # no longer can write to STDOUT from this point on. works if # I delete the line $image->Write ....