Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use diagnostics; use Image::Magick; use Getopt::Long; use File::Basename; my $out_dir = 'icons'; my $geometry= '120x120'; GetOptions( 'geometry=s' => \$geometry, 'directory=s' => \$out_dir, ); mkdir $out_dir, 0777 or die "Cannot create $out_dir: $!" unless -d $ou +t_dir; foreach my $img (@ARGV) { my $rc; my $im = Image::Magick->new(); $rc = $im->Read($img); warn($rc), next if $rc; my $basename = basename $img; $basename =~ s/\.\w+$//; $rc = $im->Write("PNG:$out_dir/$basename.png"); warn($rc) if $rc; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Questions about command line script
by gjb (Vicar) on Nov 07, 2002 at 21:33 UTC | |
by Anonymous Monk on Nov 07, 2002 at 21:39 UTC | |
|
Re: Questions about command line script
by waswas-fng (Curate) on Nov 07, 2002 at 21:35 UTC |