サンプルの縮小処理で描画した画像をPerlモジュールのImage::Magickで生成
PerlモジュールのImage::Magickを使用して、サンプルの縮小処理で描画した画像を出力しました。Sampleメソッドのgeometry属性で、横幅のピクセル数を指定した縮小処理を実行しています。)
#!/opt/local/bin/perl use strict; use warnings; use Image::Magick; my $image = Image::Magick->new(magick => "jpeg"); $image->Read("sample.jpg"); $image->Sample(geometry => "600x"); print "Content-type: image/jpeg\n\n"; $image->Write("jpeg:-"); undef $image; exit;
サンプルコードと出力結果です。Sampleを描画した画像を出力しました。