X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FCommon.pm;h=76da6befeb3466f6620f354ad5a8ef251b7f99a6;hb=59921df12b46d8d77698a7a5fb268fc98c6c2c4c;hp=e545e91d9e5a06704a2bc30baf949a3badaf95dd;hpb=3190115fc3d69debf06c037528bfa98fe4cfdc96;p=pr0n diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index e545e91..76da6be 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -31,7 +31,7 @@ BEGIN { require Sesse::pr0n::Config_local; }; - $VERSION = "v2.04"; + $VERSION = "v2.05"; @ISA = qw(Exporter); @EXPORT = qw(&error &dberror); %EXPORT_TAGS = qw(); @@ -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); }