~mdw
/
tgal
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mason/.perl-lib/TrivGal.pm, mason/dhandler: Rescale images lazily.
[tgal]
/
mason
/
.perl-lib
/
TrivGal.pm
diff --git
a/mason/.perl-lib/TrivGal.pm
b/mason/.perl-lib/TrivGal.pm
index
ec011f3
..
e329e00
100644
(file)
--- a/
mason/.perl-lib/TrivGal.pm
+++ b/
mason/.perl-lib/TrivGal.pm
@@
-217,8
+217,8
@@
package TrivGal::Image {
}, $cls;
}
}, $cls;
}
- sub scale ($$) {
- my ($me, $scale) = @_;
+ sub scale ($$
;$
) {
+ my ($me, $scale
, $forcep
) = @_;
my $m = HTML::Mason::Request->instance;
my $path = $me->{path};
my $m = HTML::Mason::Request->instance;
my $path = $me->{path};
@@
-228,6
+228,9
@@
package TrivGal::Image {
$m->interp->apply_escapes("$CACHEURL/scale.$sz/$path", "u");
my $st = stat $thumb;
if (defined $st && $st->mtime > $me->{mtime}) { return $thumburl; }
$m->interp->apply_escapes("$CACHEURL/scale.$sz/$path", "u");
my $st = stat $thumb;
if (defined $st && $st->mtime > $me->{mtime}) { return $thumburl; }
+ return
+ $m->interp->apply_escapes("$SCRIPTURL/$path", "u") . "?scale=$scale"
+ unless $forcep;
my ($dir, $base, $ext) = TrivGal::split_path $thumb;
my $ty = $TYPE{lc $ext} or die "unknown type `$ext'";
my ($dir, $base, $ext) = TrivGal::split_path $thumb;
my $ty = $TYPE{lc $ext} or die "unknown type `$ext'";