On Fri, 2003-09-12 at 21:02, K Old wrote: > On Fri, 2003-09-12 at 10:57, Ramprasad A Padmanabhan wrote: > > Hi all, > > I am trying to convert my gifs and png to thumbnails > > > > Does anyone know a library that can help me > > > Ram, > > I use Image::Thumbnail (available on CPAN) to convert jpegs, but I'm > sure there's a way to get gifs working. This module sits on top of GD > which can be trouble to setup. > > Anyway, here's a script I use to convert images to thumbnails: > #!/usr/bin/perl -w > use Image::Thumbnail; > > $src_dir = "/home/ic/catalogs/em/images/items"; > $dest_dir = "/home/ic/catalogs/em/images/thumb"; > > opendir(DIR, $src_dir) or die "can't opendir $src_dir: $!"; > > while (defined($file = readdir(DIR))) { > if($file =~ /je?pg$/) { > > print "$src_dir/$file\n"; > print "$dest_dir/$file\n"; > # Create a thumbnail from 'test.jpg' as 'test_t.jpg' > # using ImageMagick, or GD. > my $t = new Image::Thumbnail( > module => GD, > size => 100, > create => 1, > inputpath => "$src_dir/$file", > outputpath => "$dest_dir/$file", > ); > > } > } > > HTH, > Kevin
Thanks pal But installing GD is a pain. And I realize perl is not a language to do image manipulation in. I have used a system call to 'convert' instead Thanks anyway Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]