kmarshall has asked for the wisdom of the Perl Monks concerning the following question:
However, my images are in multiple directories and it is not working when I try to use the script like this:use Image::Size; for (glob '*.jpg') { my ($x, $y) = imgsize($_); print "$_: xsize = $x, ysize = $y<BR>\n"; }
I am not sure what I am doing wrong, but if anyone could help me, I would much appreciate it. Thanks in advance, Kyleopendir(DIR,"../images/dir/name"); @files = readdir(DIR); close(DIR); use Image::Size; for(@files) { if ($_ =~ /.*.*\..*/) { if ($_ =~ /.jpg/ || $_ =~ /.JPG/) { my ($x, $y) = imgsize($_); print "$_: x=$x, y=$y<BR>\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Image::Size
by davidrw (Prior) on Sep 23, 2005 at 21:31 UTC | |
by kmarshall (Novice) on Sep 24, 2005 at 01:36 UTC | |
|
Re: Using Image::Size
by Tanktalus (Canon) on Sep 23, 2005 at 23:16 UTC | |
by kmarshall (Novice) on Sep 24, 2005 at 01:31 UTC | |
by Tanktalus (Canon) on Sep 24, 2005 at 02:28 UTC | |
by kmarshall (Novice) on Sep 24, 2005 at 03:07 UTC | |
by Tanktalus (Canon) on Sep 24, 2005 at 15:04 UTC | |
| |
by nedals (Deacon) on Sep 24, 2005 at 01:57 UTC |