Image::Magick::Thumbnail::Fixed - Perl extension for creating fixed sized thumbnails without distortion.
use Image::Magick::Thumbnail::Fixed; my $t = new Image::Magick::Thumbnail::Fixed; # Required parameters $t->thumbnail( input => 'input.jpg', output => 'output.jpg', width => 96, height => 72 ); # Required and optional parameters $t->thumbnail( input => 'input.jpg', output => 'output.jpg', width => 96, height => 72, density => '96x72', gravity => 'center', compose => 'over', quality => '90', bgcolor => 'white', format => 'jpg' );
Create fixed sized thumbnails without distorting or stretching the source image.
Example: The source image is 349 x 324 (1.077 ratio). The thumbnail image is to be 96x72 (1.333 ratio). Resizing the source image to 96 x 72 will cause distortion. This module will first resize the source in memory (to 66 x 71) and then compose it ontop of the thumbnail canvas.
Image::Magick
The input path of the source image.
The output path of the thumbnail image.
The width of the thumbnail image.
The height of the thumbnail image.
See http://imagemagick.org/www/perl.html for information regarding optional parameters (density, gravity, compose, color, quality, format).
Vertical and horizontal resolution in pixels of the image. Takes an ImageMagick 'geometry' string (ie: '96x72'). Default: width x height of the thumbnail.
Type of image gravity. Options: {Forget, NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast} Default: center
Composite operator. Options: {Over, In, Out, Atop, Xor, Plus, Minus, Add, Subtract, Difference, Bumpmap, Copy, Mask, Dissolve, Clear, Displace} Default: over
Background color of the thumbnail canvas (will only show if the ratio of the source does not match the ratio of the thumbnail). Options: http://imagemagick.org/www/color.html Default: white
JPEG/MIFF/PNG compression level (range 0-100). Default: 70
Image format. Default: jpg
None by default.
Version 0.01 (18 August 2004): Initial Revision
Version 0.02 (31 August 2004): Perl 5.6.1 support, fixed height/width calculations that were broken in certain situations.
Version 0.03 (25 September 2004): made debug mode more verbose. Caught additional errors.
Version 0.04 (26 April 2005): Fixed debugging conditional that was too loud - pd <paul@dowling.id.au>, fixed bug with square images - Phillip Munt <phil@savvyshopper.net.au>.
Image::Magick, Image::Magick::Thumbnail, Image::Thumbnail
Adam Roth, <aroth@cpan.org>
Copyright 2004 by Adam Roth, all rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head2'
To install Image::Magick::Thumbnail::Fixed, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Image::Magick::Thumbnail::Fixed
CPAN shell
perl -MCPAN -e shell install Image::Magick::Thumbnail::Fixed
For more information on module installation, please visit the detailed CPAN module installation guide.