mason/.perl-lib/TrivGal.pm (Image::scale): Factor out thumbnail path tail.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 20 Jun 2023 22:51:10 +0000 (23:51 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 21 Jun 2023 09:18:38 +0000 (10:18 +0100)
mason/.perl-lib/TrivGal.pm

index 513a682..594b383 100644 (file)
@@ -243,9 +243,9 @@ package TrivGal::Image {
     if ($me->sz <= $sz)
       { return $m->interp->apply_escapes("$IMGURL/$path", "u"); }
 
-    my $thumb = "$CACHE/scale.$sz/$path";
-    my $thumburl =
-      $m->interp->apply_escapes("$CACHEURL/scale.$sz/$path", "u");
+    my $tail = "scale.$sz/$path";
+    my $thumb = "$CACHE/$tail";
+    my $thumburl = $m->interp->apply_escapes("$CACHEURL/$tail", "u");
     my $st = stat $thumb;
     if (defined $st && $st->mtime > $me->{mtime}) { return $thumburl; }
     return