X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=perl%2FSesse%2Fpr0n%2FCommon.pm;h=e339fd3ab596026f33390cdefa97579ecce2a249;hb=705c77424bb19f5be37865d99995390926ea0b9f;hp=d2002c13a66de78547c00f1639989bdb9c3dc1a8;hpb=9591c060e1247afa084abd5f8cbd70023357b220;p=pr0n diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index d2002c1..e339fd3 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -35,7 +35,7 @@ BEGIN { require Sesse::pr0n::Config_local; }; - $VERSION = "v2.52"; + $VERSION = "v2.53"; @ISA = qw(Exporter); @EXPORT = qw(&error &dberror); %EXPORT_TAGS = qw(); @@ -371,7 +371,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 || !defined($dbwidth) || !defined($dbheight) || $xres == -1)) { + unless (defined($xres) && (!defined($dbwidth) || !defined($dbheight) || $xres < $dbheight || $yres < $dbwidth || $xres == -1)) { return ($fname, 0); } @@ -557,12 +557,16 @@ sub make_infobox { # Apache2::ServerUtil->server->log_error(join(':', keys %$info)); + my $iso = undef; if (defined($info->{'NikonD1-ISOSetting'})) { - push @classic_fields, [ $info->{'NikonD1-ISOSetting'}->[1] . " ISO", 0 ]; - } elsif (defined($info->{'ISOSetting'})) { - push @classic_fields, [ $info->{'ISOSetting'} . " ISO" ]; + $iso = $info->{'NikonD1-ISOSetting'}; } elsif (defined($info->{'ISO'})) { - push @classic_fields, [ $info->{'ISO'} . " ISO" ]; + $iso = $info->{'ISO'}; + } elsif (defined($info->{'ISOSetting'})) { + $iso = $info->{'ISOSetting'}; + } + if (defined($iso) && $iso =~ /(\d+)/) { + push @classic_fields, [ $1 . " ISO", 0 ]; } if (defined($info->{'ExposureBiasValue'}) && $info->{'ExposureBiasValue'} ne "0") {