]> mj.ucw.cz Git - gallery.git/blobdiff - gal2/gal-gen
Gallery2: gen-cache
[gallery.git] / gal2 / gal-gen
index 970e3d2b9950aeb11e9ffe2d9fb85b6c142664f1..d8edb57e6ba7e00401ebf1595136a2e9339a08d3 100755 (executable)
@@ -8,7 +8,6 @@ use warnings;
 use lib '/home/mj/web/gal2';
 use UCW::Gallery;
 
 use lib '/home/mj/web/gal2';
 use UCW::Gallery;
 
-use File::Spec;
 use Image::Magick;
 use IO::Handle;
 use File::Spec;
 use Image::Magick;
 use IO::Handle;
 use File::Spec;
@@ -23,9 +22,9 @@ my $orig_list = UCW::Gallery::ReadList('gallery.list') or die "Cannot read galle
 
 my $photo_dir = $UCW::Gallery::CF{'PhotoDir'};
 if (-d $photo_dir) {
 
 my $photo_dir = $UCW::Gallery::CF{'PhotoDir'};
 if (-d $photo_dir) {
-       print "Using existing output directory $photo_dir\n";
+       print "Using existing output directory: $photo_dir\n";
 } else {
 } else {
-       print "Creating output directory $photo_dir\n";
+       print "Creating output directory: $photo_dir\n";
        File::Path::mkpath($photo_dir) or die "Unable to create $photo_dir: $!\n";
 }
 
        File::Path::mkpath($photo_dir) or die "Unable to create $photo_dir: $!\n";
 }
 
@@ -36,12 +35,13 @@ if (-f $photo_meta) {
        $old_meta = UCW::Gallery::ReadMeta($photo_meta);
        # use Data::Dumper; print "Read old meta: ", Dumper($old_meta), "\n";
 }
        $old_meta = UCW::Gallery::ReadMeta($photo_meta);
        # use Data::Dumper; print "Read old meta: ", Dumper($old_meta), "\n";
 }
-my $meta = { 'photo' => {} };
+my $meta = { 'photo' => {}, 'sequence' => [] };
 
 for my $f (@$orig_list) {
        my $id = $f->{id};
        my $rotate = $f->{orientation};
        my $xfrm = $f->{xfrm};
 
 for my $f (@$orig_list) {
        my $id = $f->{id};
        my $rotate = $f->{orientation};
        my $xfrm = $f->{xfrm};
+       push @{$meta->{sequence}}, $id;
        print "$id: ";
 
        my $p = new Image::Magick;
        print "$id: ";
 
        my $p = new Image::Magick;