]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/Common.pm
Parse the focal length information from the D300 correctly.
[pr0n] / perl / Sesse / pr0n / Common.pm
index 6198441e8443d5dd787b82f4e8eaff9ce6a7e5a9..eb111ceb9dc513c50987ba7e9683c66706592217 100644 (file)
@@ -35,7 +35,7 @@ BEGIN {
                require Sesse::pr0n::Config_local;
        };
 
-       $VERSION     = "v2.53";
+       $VERSION     = "v2.60";
        @ISA         = qw(Exporter);
        @EXPORT      = qw(&error &dberror);
        %EXPORT_TAGS = qw();
@@ -419,7 +419,7 @@ sub make_mipmap {
 
                push @mmlist, [ $mmwidth, $mmheight ];
        }
-
+               
        # Ensure that all of them are OK
        my $last_good_mmlocation;
        for my $i (0..$#mmlist) {
@@ -461,6 +461,9 @@ sub make_mipmap {
                }
        }
 
+       if (!defined($img)) {
+               $img = read_original_image($r, $id, $dbwidth, $dbheight);
+       }
        return $img;
 }
 
@@ -638,7 +641,7 @@ sub make_infobox {
                $info->{'ExposureProgram'} =~ /aperture\b.*\bpriority/i);
 
        my @classic_fields = ();
-       if (defined($info->{'FocalLength'}) && $info->{'FocalLength'} =~ /^(\d+)(?:\.\d+)?(?:mm)?$/) {
+       if (defined($info->{'FocalLength'}) && $info->{'FocalLength'} =~ /^(\d+)(?:\.\d+)?\s*(?:mm)?$/) {
                push @classic_fields, [ $1 . "mm", 0 ];
        } elsif (defined($info->{'FocalLength'}) && $info->{'FocalLength'} =~ /^(\d+)\/(\d+)$/) {
                push @classic_fields, [ (sprintf "%.1fmm", ($1/$2)), 0 ];