in reply to Re: GD, ImageMagik, are there others?
in thread GD, ImageMagik, are there others?

Whaaaaahoooo!

I'd never heard of Imager and this module changes my life. All I have wanted to do is take client uploaded images, of any sort, and size them to jpeg thumbnails and full size for an online gallery. GD has lousy quality and ImageMagik is just too scary. Anyway, I had Imager working like a charm in minutes.

#!/usr/bin/perl print "Content-type: text/html\n\n"; use Imager; use warnings; use strict; use CGI::Carp qw(fatalsToBrowser); my $img = Imager->new(); $img->read(file=>"../Uploaded_image.tif") or die $img->errstr; my $imgfull = Imager->new(); my $imgfull = $img->scale(xpixels => 500); # 400x285 $imgfull->write(file=>"../Uploaded_image.jpg", type=>"jpeg") or die "Cannot write: ", $imgfull->errstr; my $imgthum = Imager->new(); my $imgthum = $img->scale(xpixels => 100); # 400x285 $imgthum->write(file=>"../Uploaded_image_thumb.jpg", type=>"jpeg") or die "Cannot write: ", $imgthum->errstr;

Thanks!


—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot