Perl Basics
Introduction to Perl
FAQ's
CGI
Regular Expressions

PC Overview
Cool Stuff
My Modules
Success Stories
Links
Perl in the News
Logos
Perl @ msn
Perl Chat

PC Internals
About
Contact
Guest Book
Handy Logos
What's new

Image Manipulation with Perl

Image Manipulation and Resizing
P-friendly

[ home ] - [ search ] - [ sitemap ]

Since GD 2.0.5 is a pain, I'm trying to get Image::Magick up and running. For those who are prepared for an adventure, the latest stable version of GD seems to be GD-1.19.tar.gz


Links

http://www.imagemagick.org/www/perl.html
http://imagemagick.sourceforge.net/http/?M=D
http://imagemagick.sourceforge.net/http/perl/?M=D

Image::Magick Samples

http://files.beerta.de/projects/mkgallery.pl

Get current image size

$srcim = Image::Magick->new;
( $width, $height, $srcsize, $format ) = $srcim->Ping($image);

Create Thumbnail

$srcim = Image::Magick->new;

$thumb = dirname($image) . "/thumb/" . basename($image) . ".jpg";

$err = $srcim->Read($image);
warn "$err" if "$err";

$srcim->Scale( geometry => '120x90' );

$err = $srcim->Write("$thumb");
warn "Warning: $err while processing $image" if "$err";

Image Resizing

Binary Usage for System Call

montage -geometry {width} {infile} {outfile}

You just need to install two RPM's for using this tool:

On RedHat 7.3 just download these RPM's and then type

rpm -Uhv ImageMagick-5.5.7-10.i386.rpm ImageMagick-devel-5.5.7-10.i386.rpm

home - feedback - search - web jobs
© 1998-2004 retoh :)