Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Error Handling

by joealba (Hermit)
on Jun 21, 2002 at 15:02 UTC ( [id://176294]=note: print w/replies, xml ) Need Help??


in reply to Error Handling

You might want to look into PerlMagick - the Object Oriented interface to the ImageMagick goodness.

Here's the PerlMagick way to do what you're doing. It will also give you some better error handling.
use Image::Magick; my $photo = Image::Magick->new(); my $x = $photo->ReadImage($input); if ($x) { warn $x; # This will catch any bad files or serious errors in reading the ima +ge } my ($height, $width) = $photo->Get('height','width');
You can find your other attributes here on the PerlMagick page.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found