in reply to reading file size of web images
use LWP::Simple; local $\ = "\n"; # add newline to print print +(head('http://perlmonks.org/images/monk1sm.gif'))[1];
If you mean the image dimensions, you'll have to download the file, for example using get() or getstore() from LWP::Simple, and read the dimensions with Image::Size or Image::Info.
Here I use Image::Info because it doesn't require the image to be stored as a file — just use a scalar reference to the raw image data:
use LWP::Simple; use Image::Info qw(image_info dim); my $raw = get('http://perlmonks.org/images/monk1sm.gif'); printf "WxH: %dx%d\n", dim(image_info(\$raw));
|
|---|