アップロード掲示板にリサイズ機能を持たせたのですがリサイズがうまくいきません。
widthが1600程度ならなんとかなるのですが、2000を超えるものになるとなぜか
リサイズ後の画像が真っ暗になっています・・
コードが悪いのでしょうか・・?
当方レンタルサーバにて、ImageMagick対応とのことでしたのでネットで調べながら
ImageMagickにてリサイズを行いました

以下リサイズロジックです。
use Image::Magick;
$file = "./test.jpg";
$img_w_max = 860;
my $new_image = Image::Magick->new;
$new_image->Read("$file");
my $width = $new_image -> Get('width');
my $height = $new_image -> Get('height');
if ($width > $img_w_max) {
my $ratio = $img_w_max / $width;
my $width_new = $width * $ratio; my $height_new = $height * $ratio;
$new_image->Scale(width=>"$width_new", height=>"$height_new");
$new_image ->Write("$file");
}
print "Content-type: image/jpeg\n\n";
binmode STDOUT;
$new_image->Write('jpeg:-');
undef $new_image;
exit;
アドバイスお願いしますorz