From: Steinar H. Gunderson Date: Sat, 19 Jan 2008 22:25:33 +0000 (+0100) Subject: Extract the number only from the ISO value. X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=705c77424bb19f5be37865d99995390926ea0b9f;hp=b3731a6d90f8d8bc547b4af5c815b039cc40aadf Extract the number only from the ISO value. --- diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index 3463fe6..e339fd3 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -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 ]; + $iso = $info->{'NikonD1-ISOSetting'}; } elsif (defined($info->{'ISO'})) { - push @classic_fields, [ $info->{'ISO'} . " ISO" ]; + $iso = $info->{'ISO'}; } elsif (defined($info->{'ISOSetting'})) { - push @classic_fields, [ $info->{'ISOSetting'} . " ISO" ]; + $iso = $info->{'ISOSetting'}; + } + if (defined($iso) && $iso =~ /(\d+)/) { + push @classic_fields, [ $1 . " ISO", 0 ]; } if (defined($info->{'ExposureBiasValue'}) && $info->{'ExposureBiasValue'} ne "0") {