NAME

MT::Image - Movable Type image manipulation routines


SYNOPSIS

    use MT::Image;
    my $img = MT::Image->new( Filename => '/path/to/image.jpg' );
    my($blob, $w, $h) = $img->scale( Width => 100 );
    open FH, ">thumb.jpg" or die $!;
    binmode FH;
    print FH $blob;
    close FH;


DESCRIPTION

MT::Image contains image manipulation routines using either the NetPBM tools or the ImageMagick and Image::Magick Perl module. The backend framework used (NetPBM or ImageMagick) depends on the value of the ImageDriver setting in the mt.cfg file (or, correspondingly, set on an instance of the MT::ConfigMgr class).

Currently all this is used for is to create thumbnails from uploaded images.


USAGE

MT::Image->new(%arg)

Constructs a new MT::Image object. Returns the new object on success; on error, returns undef, and the error message is in MT::Image->errstr.

%arg can contain:

$img->scale(%arg)

Creates a thumbnail from the image represented by $img; on success, returns a list containing the binary contents of the thumbnail image, the width of the scaled image, and the height of the scaled image. On error, returns undef, and the error message is in $img->errstr.

%arg can contain:


AUTHOR & COPYRIGHT

Please see the MT manpage for author, copyright, and license information.