use Image::Thumbnail 0.65;
# Create a thumbnail from 'test.jpg' as 'test_t.jpg'
# using ImageMagick, Imager, GD or Image::Epeg.
my $t = new Image::Thumbnail(
size => 55,
create => 1,
input => 'test.jpg',
outputpath => 'test_t.jpg',
);
# Create four more of ever-larger sizes
for (1..4){
$t->{size} = 55+(10*$_);
$t->create;
}
I don't see any call to ->create in your code. Did you forget that call?
Update: Now I see - create => 1 is supposed to automatically create the thumbnail. If you use the automatic way, you won't get access to the error diagnostics, so I would look at the manual way first, to see the potential error messages:
my $t = new Image::Thumbnail(
size => 55,
create => 1,
input => 'test.jpg',
outputpath => 'test_t.jpg',
);
$t->create;
print "Errors : " . $t->{error, "\n";
print "Warnings:" . $t->{warning}, "\n";
Upon reading the source code, it seems as the module does not actually set up those fields in most situations. |