X-Git-Url: https://git.distorted.org.uk/~mdw/tgal/blobdiff_plain/1b3d679172d063c18bc687e7b3aa7df0a68d5eb1..HEAD:/mason/dhandler
diff --git a/mason/dhandler b/mason/dhandler
index 91a513b..8c151ba 100755
--- a/mason/dhandler
+++ b/mason/dhandler
@@ -35,8 +35,8 @@ of the GNU Affero General Public License.
-
- ">
+
+ ">
<% $head %>\
<% $title %>
@@ -83,22 +83,45 @@ Failed to find ‘<% $path |h %>’.
}
(my $nosl = $path) =~ s!/$!!;
- my $size = "medthumb";
+ my @size = ("smallthumb", "medthumb", "bigthumb");
my %tn;
- for my $f (@$ff)
- { $tn{$f} = TrivGal::Image->new($path . $f->name); }
+ my %count;
+ for my $f (@$ff) {
+ my $img = TrivGal::Image->new($path . $f->name);
+ for my $size (@size) { $tn{$f}{$size} = $img->scale($size); }
+ }
for my $d (@$dd) {
- my ($ddd, $fff, $iii) = listdir $real . "/" . $d->name;
- $tn{$d} = $iii ?
- TrivGal::Image->new(join_paths $path, $d->name, $iii->name) :
- undef;
+ my $p = join_paths $path, $d->name;
+ my ($ddd, $fff, $iii);
+ ($ddd, $fff, $iii) = listdir join_paths $IMGROOT, $p;
+
+ my $count = "";
+ $count .= scalar(@$ddd) . "/" if @$ddd;
+ $count .= scalar(@$fff) if @$fff;
+ $count{$d} = $count;
+
+ DIR: for (;;) {
+ if (defined $iii) {
+ my $index = join_paths $p, $iii->name;
+ my $img = TrivGal::Image->new($index);
+ for my $size (@size) { $tn{$d}{$size} = $img->scale($size); }
+ last DIR;
+ }
+ if (!@$ddd) { $tn{$d} = undef; last DIR; }
+ $p = join_paths $p, $ddd->[0]->name;
+ ($ddd, $fff, $iii) = listdir join_paths $IMGROOT, $p;
+ }
}
%perl>
%
<&| .html, title =>
"Folder " . $m->interp->apply_escapes($nosl || "[top]", "h"),
head => $links &>
-<& .breadcrumbs, what => "Folder", path => $path &>
+<&| .breadcrumbs, what => "Folder", path => $path &>
+