X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FCommon.pm;h=eb111ceb9dc513c50987ba7e9683c66706592217;hp=9a3d31cc34e9eecaf737315285d3b232b6346eab;hb=badd5d08df949436d51abdb8e972a2fc2e341bb6;hpb=a1ed3a66ce503c2b6c2d177f9ab36a148375e0d4 diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index 9a3d31c..eb111ce 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -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 ];