]> mj.ucw.cz Git - gallery.git/blobdiff - gal2/gal-cache
Gallery2: First attempts at web version
[gallery.git] / gal2 / gal-cache
index d6ee3537987833da0b414968c739d76d156de6da..5accb3fd58dace7c14bb43e7a01f71c84f4aed70 100755 (executable)
@@ -31,9 +31,8 @@ if (-d $cache_dir) {
 print "Creating cache directory: $cache_dir\n";
 File::Path::mkpath($cache_dir) or die "Unable to create $cache_dir: $!\n";
 
-for my $t (@{$CF{'ThumbSizes'}}) {
-       my ($tw, $th) = @$t;
-       my $thumb_fmt = $tw . 'x' . $th;
+for my $thumb_fmt (keys %{$CF{'ThumbFormats'}}) {
+       my ($tw, $th) = ($thumb_fmt =~ m{^(\d+)x(\d+)$}) or die "Cannot parse thumbnail format $thumb_fmt\n";
        print "Generating $thumb_fmt thumbnails\n";
        my $thumb_meta = {};
        $meta->{thumb}->{$thumb_fmt} = $thumb_meta;