...

View Full Version : ImageMagick tips plz



bazz
02-16-2010, 11:39 PM
Hi,

I have several different thumbnail sizes being used around my site and I want to simplify the process by using the enlargement and re-scaling it.

Trouble is; with IMageMagick, I am unsure whether to use Resize or Thumbnail.

Both snippets are below. which is best and why. I did read the docs but didn't see anything to explain

http://www.imagemagick.org/script/perl-magick.php



#!/usr/local/bin/perl
use Image::Magick;

my($image, $x);

$image = Image::Magick->new;
$x = $image->Read('bedroom.jpg');
warn "$x" if "$x";

$x = $image->Resize(geometry=>'150x100');
warn "$x" if "$x";

$x = $image->Write('bedroom.jpg');
warn "$x" if "$x";



#######################################


#!/usr/local/bin/perl
use Image::Magick;

my($image, $x);

$image = Image::Magick->new;
$x = $image->Read('bedroom.jpg');
warn "$x" if "$x";

$x = $image->Thumbnail(geometry=>'150x100');
warn "$x" if "$x";

$x = $image->Write('bedroom.jpg');
warn "$x" if "$x";



point to note: I am making a thumbnail where the proportions of the image remain the same eg 16:9

bazz



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum