X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FCommon.pm;h=dcaf244af5e84330988d93c12b858de539f68d91;hp=e929b654d998e8674fd141d9f0a62592d70415f1;hb=82b2e541984df6f697a5a73f2faaa99e40dfc832;hpb=a58f1ab4dd5b224b12ed78096b6867f47c316231 diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index e929b65..dcaf244 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -356,7 +356,7 @@ sub ensure_cached { my ($r, $filename, $id, $dbwidth, $dbheight, $infobox, $xres, $yres, @otherres) = @_; my $fname = get_disk_location($r, $id); - unless (defined($xres) && ($xres < $dbheight || $yres < $dbwidth || $dbwidth == -1 || $dbheight == -1 || $xres == -1)) { + unless (defined($xres) && ($xres < $dbheight || $yres < $dbwidth || !defined($dbwidth) || !defined($dbheight) || $xres == -1)) { return ($fname, 0); } @@ -405,7 +405,7 @@ sub ensure_cached { my $height = $img->Get('rows'); # Update the SQL database if it doesn't contain the required info - if ($dbwidth == -1 || $dbheight == -1) { + if (!defined($dbwidth) || !defined($dbheight)) { $r->log->info("Updating width/height for $id: $width x $height"); update_image_info($r, $id, $width, $height); }