NAME

Image::Magick::Thumbnail - Produces thumbnail images with ImageMagick

SYNOPSIS

use Image::Magick::Thumbnail 0.06;
# Load the source image
my $src = Image::Magick->new;
$src->Read('source.jpg');

# Create the thumbnail from it, where the biggest side is 50 px
my ($thumb, $x, $y) = Image::Magick::Thumbnail::create($src, 50);

# Save your thumbnail
$thumb->Write('source_thumb.jpg');

# Create another thumb, that fits into the geometry
my ($thumb2, $x2, $y2) = Image::Magick::Thumbnail::create($src, '60x50');

# Create yet another thumb, fitting partial geometry
my ($thumb3, $x3, $y3) = Image::Magick::Thumbnail::create($src, 'x50');

__END__

DESCRIPTION

This module uses the ImageMagick library to create a thumbnail image with no side bigger than you specify.

There is no OO API, since that would seem to be over-kill. There's just create.

create

my ($im_obj, $x, $y) = Image::Magick::Thumbnail->create( $src, $maxsize_or_geometry);

The create routine may be accessed as a subroutine or class method. It takes two arguments: the first is an ImageMagick image object, the second is either the size in pixels you wish the longest side of the image to be, or an Image::Magick-style 'geometry' (eg 100x120) which the thumbnail must fit. Missing part of the geometry is fine.

returns an Imaeg::Magick image object (the thumbnail), as well as the number of pixels of the width and height of the image, as integer scalars, and (mainly for testing) the ration used in the scaling.

PREREQUISITES

Image::Magick

WARNINGS

Will warn on bad or missing arguments if you have used warnings.

EXPORTS

None by default.

AUTHOR

Lee Goddard <LGoddard@CPAN.org>

SEE ALSO

perl, Image::Magick, Image::GD::Thumbnail, and Image::Thumbnail for the same formula for various engines.

COPYRIGT

Copyright (C) Lee Godadrd 2001-2008. all rights reserved. Available under the same terms as Perl itself.