]> mj.ucw.cz Git - gallery.git/blobdiff - gal/bin/gal-cache
Gallery2: Front-end attachment reform
[gallery.git] / gal / bin / gal-cache
index da9a29132dfbab2ec26aa96ca95737970e3350d8..904b85e3e04c28c4a93463802b6456056151809b 100755 (executable)
@@ -40,9 +40,9 @@ for my $f (@$orig_list) {
        $m->{title} = $f->{title};
 }
 
-for my $thumb_fmt (keys %{$gal->get('ThumbFormats')}) {
-       my ($tw, $th) = ($thumb_fmt =~ m{^(\d+)x(\d+)$}) or die "Cannot parse thumbnail format $thumb_fmt\n";
+for my $thumb_fmt (@{$gal->get('ThumbFormats')}) {
        print "Generating $thumb_fmt thumbnails\n";
+       my ($tw, $th) = $gal->thumb_fmt_to_size($thumb_fmt);
        my $thumb_meta = {};
        $meta->{thumb}->{$thumb_fmt} = $thumb_meta;
        my $thumb_dir = File::Spec->catfile($cache_dir, $thumb_fmt);