in reply to Re: file i/o beyond my knowledge
in thread file i/o beyond my knowledge
#!/usr/bin/perl # Import Modules # use File::Copy; use Image::Magick; use File::Find; # Prompt for Directory # print "Enter Directory: "; chomp($dir = <STDIN>); # Find Images # find(\&mogrify, $dir); # Resize Images # # Write to thumbnails directory # # With same filename extension # sub mogrify { $img = Image::Magick->new; $img->Read($_); # Test for Extensions # if ($_ =~ /\.(\w+)$/) { $ext2 = $1; } my $ext = $ext2; $img->Resize('geometry' => "120x120", 'filter' => "Cubic"); $img->Write("$_"."-thumb"."\.$ext2"); } # Make the directory of thumbnails # system("mkdir thumbnails"); # Move all thumbnails to the thumbnails directory # system("move *thumb*.*, thumbnails");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: file i/o beyond my knowledge
by firstbaseman83 (Initiate) on Jan 15, 2003 at 02:50 UTC | |
by firstbaseman83 (Initiate) on Jan 15, 2003 at 17:49 UTC |