From 705c77424bb19f5be37865d99995390926ea0b9f Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 19 Jan 2008 23:25:33 +0100 Subject: [PATCH] Extract the number only from the ISO value. --- perl/Sesse/pr0n/Common.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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") { -- 2.39.2