chiark / gitweb /
mason/.perl-lib/TrivGal.pm (Image::scale): Sink parsing the path name.
[tgal] / mason / .perl-lib / TrivGal.pm
index 96f66f12ea693318999d190383514682b49a23c7..e6bfcf4836dcd929af925c979c50e75783f586d9 100644 (file)
@@ -257,9 +257,6 @@ package TrivGal::Image {
          $m->interp->apply_escapes("$SCRIPTURL/$path", "u") .
          "?scale=$scale";
       } else {
-       my ($dir, undef, $ext) = TrivGal::split_path $thumb;
-       my $ty = $TYPE{lc $ext} or die "unknown type `$ext'";
-
        my $img = $me->{img};
        unless (defined $img) {
          my $exif = new Image::ExifTool;
@@ -273,6 +270,8 @@ package TrivGal::Image {
          }
        }
 
+       my ($dir, undef, $ext) = TrivGal::split_path $thumb;
+       my $ty = $TYPE{lc $ext} or die "unknown type `$ext'";
        my $sc = $sz/$me->sz;
        my $scaled = $img->create_scaled_image($sc*$wd, $sc*$ht);