Page 1 of 1

Exceptions cannot be caught - always stops execution

Posted: 2007-03-24T02:22:59-07:00
by hermann2
Hi,

Ok, so I've spent the past 3 hours banging my head against a brick wall. I hope someone out there can help. I'm using ImageMagick 6.0.7 with the PerlMagick API on Linux ES4.

I'm trying to catch any exceptions encountered during the following operation:

Code: Select all

my $err = $image->Annotate(x=>20, y=>39, fill=>"#330000", font=>"VAGRound", badparameter=>'233', text=>'Hello');
print "Exception: $err \n";
HOWEVER, perl simply stops and gives me the error, 'Exception 410: unrecognized option 'badparameter' at ..., without ever getting to the print statement.

I've tried using eval, to no avail. Also, BTW, prior to calling Annotate(), I construct the image as follows (without problems) in case it matters:

Code: Select all

my $image = Image::Magick->new(magick=>'gif');
$image->BlobToImage($img);
Does anyone have *any* idea what's going on? Is there a special setting I need to set so that ImageMagick/PerlMagick will behave as stated in the documentation?

Thanks in advance!

Re: Exceptions cannot be caught - always stops execution

Posted: 2007-03-24T05:40:24-07:00
by magick
We tried your script with ImageMagick 6.3.3 and it worked as expected. You may need to upgrade.

Re: Exceptions cannot be caught - always stops execution

Posted: 2007-03-24T12:41:23-07:00
by hermann2
I ran this on a different machine with ImageMagick 6.2.9, and it worked as expected. Thank you for the suggestion!

So, it's clear that there's an issue with 6.0.7 in catching exceptions. This is somewhat significant in that this is the standard release of ImageMagick on RH ES4. Luckily, they've moved to 6.2.8 with the recent release of ES5, but to all you ES4+ImageMagick users still out there, beware...

Thanks again for the assist!