X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FCommon.pm;h=cb02a154c90912ba5e1b7065d2641203497f5801;hp=e545e91d9e5a06704a2bc30baf949a3badaf95dd;hb=576c411da9608bb7155e89811694f9f19e542773;hpb=ff3856b866fcbf52850d7c92a270825de3126b26 diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index e545e91..cb02a15 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -269,7 +269,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)) { + unless (defined($xres) && ($xres < $dbheight || $yres < $dbwidth || $dbwidth == -1 || $dbheight == -1 || $xres == -1)) { return ($fname, 0); } @@ -341,9 +341,11 @@ sub ensure_cached { $quality = 80; } - $cimg->Resize(width=>$nwidth, height=>$nheight, filter=>$filter); + if ($xres != -1) { + $cimg->Resize(width=>$nwidth, height=>$nheight, filter=>$filter); + } - if (($nwidth >= 800 || $nheight >= 600) && $infobox == 1) { + if (($nwidth >= 800 || $nheight >= 600 || $xres == -1) && $infobox == 1) { make_infobox($cimg, $info, $r); }