mason/.perl-lib/TrivGal.pm (Image::scale): Sink parsing the path name.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 21 Jun 2023 09:15:19 +0000 (10:15 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 21 Jun 2023 09:21:39 +0000 (10:21 +0100)
This is more logically associated with the output stage.

mason/.perl-lib/TrivGal.pm

index 96f66f1..e6bfcf4 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);