SourceForge has been redesigned. Learn more.
Close

Diff of /lib/Panotools/Photos.pm [df1d7b] .. [32bf97]  Maximize  Restore

Switch to unified view

a/lib/Panotools/Photos.pm b/lib/Panotools/Photos.pm
...
...
162
    for my $image (@{$self})
162
    for my $image (@{$self})
163
    {
163
    {
164
        my $et = $image->{exif}->{ShutterSpeedValue} || $image->{exif}->{ExposureTime} || $image->{exif}->{ShutterSpeed} || 0;
164
        my $et = $image->{exif}->{ShutterSpeedValue} || $image->{exif}->{ExposureTime} || $image->{exif}->{ShutterSpeed} || 0;
165
        $speeds->{$et} = 'TRUE';
165
        $speeds->{$et} = 'TRUE';
166
    }
166
    }
167
    return [sort {_longer ($b, $a)} keys %{$speeds}];
167
    return [sort {_normalise ($b) <=> _normalise ($a)} keys %{$speeds}];
168
}
168
}
169
169
170
sub _longer
170
sub _normalise
171
{
171
{
172
    my ($A, $B) = @_;
172
    my $number = shift;
173
    if ($A =~ /^1\/([0-9]+)$/) {$A = 1 / $1};
173
    if ($number =~ /^1\/([0-9]+)$/) {$number = 1 / $1};
174
    if ($B =~ /^1\/([0-9]+)$/) {$B = 1 / $1};
175
    return 0 if ($B > $A);
176
    return 1;
174
    return $number;
177
}
175
}
178
176
179
=pod
177
=pod
180
178
181
Given a set of photos, split it into a one or more sets by looking at the
179
Given a set of photos, split it into a one or more sets by looking at the