in reply to Undefined value in gt (>) -> 800MB memory usage
Sounds like a bug in ImageMagick or (not very) possibly IIS. You'll probably have more luck asking on the ImageMagick mailing list. The problem is extremly unlikely to be the greater-than test, most likely it's the Ping method that goes into a tailspin.
I wanted to comment on the following piece of code though:
Which, really, is very ugly. For one, that longwinded if can be expressed with a lot more brevity: $imgparams{THREED} = $image_x > $gallerycfg{'3DWIDTH'} ? 1 : 0; See perlop for the ternary operator. Much more important though, is your error trapping practice. Perl has mechanisms to recognize an undefined variables as such, even to distinguish between a hash entry with and undefined value and one that doesn't even exist in the hash. In this case something like the following would be a lot more appropriate:$imgparams{THREED}=5; if ($image_x>$gallerycfg{'3DWIDTH'}){$imgparams{THREED}=1; }else{$imgparams{THREED}=0;} unless ($imgparams{THREED}<2){ &writelog ("Error blah blah $Absolute_URL.",1); &dieerr("The image blah blah inconvenience."); }
Then again, this makes no sense at all in your case, since the previous assignment will always either 0 or 1 to the key, so your error check is never going to trigger. I think what you were really trying to do here was something like this:unless (exists $imgparams{THREED}){ &writelog ("Error blah blah $Absolute_URL.",1); &dieerr("The image blah blah inconvenience."); }
my ($image_x, $image_y); unless(($image_x,$image_y) = $image->Ping($Absolute_URL)) { &writelog ("Error blah blah $Absolute_URL.",1); &dieerr("The image blah blah inconvenience."); }
Makeshifts last the longest.
|
|---|