This makes title changes much easier.
h height after scaling
title photo title
+The rest is present in cache.meta only:
+
$meta->{sequence} is an array of photo IDs as they appear in the gallery.
-[CacheDir only]
$meta->{thumb}->{$format}->{$identifier} is a hash of:
w thumbnail width
h thumbnail height
UCW::Gallery::LoadConfig;
+print "Reading gallery.list\n";
+my $orig_list = UCW::Gallery::ReadList('gallery.list') or die "Cannot read gallery.list: $!\n";
+
my $photo_dir = $CF{'PhotoDir'};
my $photo_meta = File::Spec->catfile($photo_dir, 'gallery.meta');
print "Reading meta-data from $photo_meta\n";
print "Creating cache directory: $cache_dir\n";
File::Path::mkpath($cache_dir) or die "Unable to create $cache_dir: $!\n";
+# Construct sequence and store photo titles
+$meta->{sequence} = [];
+for my $f (@$orig_list) {
+ push @{$meta->{sequence}}, $f->{id};
+ my $m = $meta->{photo}->{$f->{id}} or die;
+ $m->{title} = $f->{title};
+}
+
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";
UCW::Gallery::LoadConfig;
-my $orig_dir = $CF{'OrigDir'};
my $orig_list = UCW::Gallery::ReadList('gallery.list') or die "Cannot read gallery.list: $!\n";
my $photo_dir = $CF{'PhotoDir'};
$old_meta = UCW::Gallery::ReadMeta($photo_meta);
# use Data::Dumper; print "Read old meta: ", Dumper($old_meta), "\n";
}
-my $meta = { 'photo' => {}, 'sequence' => [] };
+my $meta = { 'photo' => {} };
for my $f (@$orig_list) {
my $id = $f->{id};
'xf' => $xfrm,
'w' => $w,
'h' => $h,
- 'title' => $f->{title},
};
$meta->{photo}->{$id} = $m;
- push @{$meta->{sequence}}, $id;
my $om = $old_meta->{photo}->{$id};
if ($om &&