19 Dec 2007 12:20:23 UTC
- Distribution: Image-GD-Thumbnail
- Module version: 0.041
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (0)
- Testers (713 / 0 / 2)
- KwaliteeBus factor: 0
- 33.33% Coverage
- License: unknown
- Activity24 month
- Download (2.22KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionLGODDARD Lee ♫ Goddardand 1 contributors
- Lee Goddard <cpan-at-leegoddard.net>
Image::GD::Thumbnail - produce thumbnail images with GD
use GD; use Image::GD::Thumbnail; # Load your source image open IN, 'E:/Images/test.jpg' or die "Could not open."; my $srcImage = GD::Image->newFromJpeg(*IN); close IN; # Create the thumbnail from it, where the biggest side is 50 px my ($thumb,$x,$y) = Image::GD::Thumbnail::create($srcImage,50); # Save your thumbnail open OUT, ">E:/Images/thumb_test.jpg" or die "Could not save "; binmode OUT; print OUT $thumb->jpeg; close OUT; __END__
This module uses the GD library to create a thumbnail image with no side bigger than you specify.
createtakes two arguments: the first is a GD image object, the second is the size, in pixels, you wish the image's longest side to be. It returns a new GD image object (the thumbnail), as well as the x and y dimensions, as (integer) scalars.
None by default.
Lee Goddard <cpan -at- leegoddard -dot- net>
Copyright (C) Lee Godadrd 2001 ff, all rights reserved. Available under the same terms as Perl itself.
Module Install Instructions
To install Image::GD::Thumbnail, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Image::GD::Thumbnail
For more information on module installation, please visit the detailed CPAN module installation guide.