How to easily resige images in Perl

Wednesday 17 March 2010 @ 6:46 am

How to easily resize images (jpg) in perl? Use Image::resize

use Image::Resize;
use autodie;

$src = "bigimage.jpg";
my $old = Image::Resize->new($src);
my $new = $old->resize(200, 300); # max dimensions

$jpegdata = $new->jpeg(95); # jpeg quality

open OUT, ">./smaller/$src";
print OUT $jpegdata;
close OUT;
Tags: , ,

Comments (0) - Posted in work by  




Warning: Creating default object from empty value in /home3/lech/public_html/baczynski.com/perl/wp-includes/comment-template.php on line 1056

Leave a comment