Hi All,

I'm trying to slurp a directory of JPEG images.  The script is able to read
the directory but I can not get the files to open.  Anyone have any
suggestions?

Thanks!

Brian 

Here is the output when I run the script:

Can't open images/.: No such file or directory at rezise~1.pl line 17.
Can't do inplace edit: images/.. is not a regular file at rezise~1.pl line
17.
Can't open images/L18078.jpg: No such file or directory at rezise~1.pl line
17.
Can't open images/L11373.jpg: No such file or directory at rezise~1.pl line
17.
Can't open images/L11374.jpg: No such file or directory at rezise~1.pl line
17.
Can't open images/L12883.jpg: No such file or directory at rezise~1.pl line
17.
Can't open images/L13129.jpg: No such file or directory at rezise~1.pl line
17.
Can't open images/L13178.jpg: No such file or directory at rezise~1.pl line
17.
Can't open images/L14311.jpg: No such file or directory at rezise~1.pl line
17.
Can't open images/L14448.jpg: No such file or directory at rezise~1.pl line
17.
Can't open images/L14533.jpg: No such file or directory at rezise~1.pl line
17.
Can't open images/L14627.jpg: No such file or directory at rezise~1.pl line
17.
Can't open images/L14715.jpg: No such file or directory at rezise~1.pl line
17. 

...and here is the script:

#!/user/local/bin/perl -w

use strict;
use Image::Magick;

my $images = "C:/My Documents/images";
    opendir (IMAGES, $images) or die "can not open $images: $!";

# load @ARGV for (<>)

@ARGV = map { "images/$_" } readdir IMAGES;  

my $image = Image::Magick->new(magick=>'JPEG');

# Read images, Scale down and Write to new directory

while (<>) {   <-------  line 17
    $image->Read (file=>\*ARGV)
    and $image->Scale (width=>'100', height=>'100')
    and $image->Write ("C:/My Documents/small_images")
    and close (ARGV);
    }


closedir IMAGES;

Brian Volk
HP Products
800.382.5326 x1245 
[EMAIL PROTECTED] 
        

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to