Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

(ar0n) Re: Checking Image Size

by ar0n (Priest)
on Nov 26, 2001 at 23:20 UTC ( [id://127603]=note: print w/replies, xml ) Need Help??


in reply to Checking Image Size

The easiest way to do it would probably be by using LWP::Simple (see 'get') and Image::Size (using 'imgsize'):
#!/usr/bin/perl -w use Image::Size; use LWP::Simple; use Carp; use strict; { my $loc = "http://perlmonks.org/images/usermonkpics/httptech.gif"; my $img = get $loc or croak "Can't get $loc!"; # when the argument passed to imgsize # is a reference (as opposed to a # simple scalar), it assumes it's # pointing to an in-memory buffer, # instead of to a filename. my ($width, $height) = imgsize(\$img); print "Width: $width\n", "Height: $height\n"; }

[ ar0n ]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://127603]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-25 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found