in reply to Image Xs and Ys
How about cutting your code down a bit? Also, your regex matches one or more digits in the filename, so an image called mypic1.gif will set $scale to 'mypic1.gif'. What you want is something more like:
#!/perl/bin/perl # # imagexy.pl -- script to return width and height of image(s) use strict; use warnings; use diagnostics; use Image::Size qw(:all); my $scale = ($ARGV[0] =~ /^\d+$/) ? shift : 1; for (map {glob} @ARGV) { my ($x,$y,$id) = imgsize($_); print "$_ width=",$x/$scale,"in, height=",$y/$scale,"in\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Image Xs and Ys
by hsmyers (Canon) on Jan 30, 2003 at 13:09 UTC | |
by LAI (Hermit) on Jan 30, 2003 at 17:43 UTC |