Lee ♫ Goddard > Image-GD-Thumbnail-0.041 > Image::GD::Thumbnail

Download:
Image-GD-Thumbnail-0.041.tar.gz

Dependencies

Annotate this POD

Related Modules

Tk::Thumbnail
Image::Magick
Image::Size
Tk::PNG
Tk::JPEG
File::Find
Tk::Stderr
Tk::TIFF
IO::Handle
IO::File
more...
By perlmonks.org

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.041   Source  

NAME ^

Image::GD::Thumbnail - produce thumbnail images with GD

SYNOPSIS ^

        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__

DESCRIPTION ^

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

The subroutine create takes 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.

PREREQUISITES ^

        GD

EXPORT

None by default.

AUTHOR ^

Lee Goddard <cpan -at- leegoddard -dot- net>

SEE ALSO ^

perl, GD.

COPYRIGHT ^

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

syntax highlighting: