X-Git-Url: https://git.distorted.org.uk/~mdw/tgal/blobdiff_plain/7cd805d11b686c973574dd5cab7b1cb8f907f26d..HEAD:/mason/dhandler diff --git a/mason/dhandler b/mason/dhandler index 0c834b9..8c151ba 100755 --- a/mason/dhandler +++ b/mason/dhandler @@ -83,20 +83,28 @@ Failed to find ‘<% $path |h %>’. } (my $nosl = $path) =~ s!/$!!; - my $size = "medthumb"; + my @size = ("smallthumb", "medthumb", "bigthumb"); my %tn; - my (%nd, %nf); - for my $f (@$ff) - { $tn{$f} = TrivGal::Image->new($path . $f->name)->scale($size); } + 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 $p = join_paths $path, $d->name; my ($ddd, $fff, $iii); ($ddd, $fff, $iii) = listdir join_paths $IMGROOT, $p; - $nd{$d} = @$ddd; $nf{$d} = @$fff; + + 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; - $tn{$d} = TrivGal::Image->new($index)->scale($size); + 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; } @@ -124,28 +132,30 @@ Failed to find ‘<% $path |h %>’. % % if (@$dd) {

Subfolders

+% for my $size (@size) { +% } % } % % if (@$ff) {

Images

+% for my $size (@size) { +% } % } %
@@ -277,7 +287,14 @@ Failed to find ‘<% $path |h %>’. %
% if ($link{prev}) { - + % } @@ -295,7 +312,14 @@ Failed to find ‘<% $path |h %>’. % if ($link{next}) { - + % }
%