use strict;
use warnings;
-use lib '/home/mj/web/gal2';
+use FindBin;
+use lib $FindBin::Bin;
use UCW::Gallery qw(%CF);
use Image::Magick;
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};
my $rotate = $f->{orientation};
my $xfrm = $f->{xfrm};
- push @{$meta->{sequence}}, $id;
print "$id: ";
my $p = new Image::Magick;
'w' => $w,
'h' => $h,
};
+ $meta->{photo}->{$id} = $m;
my $om = $old_meta->{photo}->{$id};
if ($om &&
$om->{h} eq $m->{h}) {
# FIXME: Remove old images?
print "... uptodate\n";
- $meta->{photo}->{$id} = $om;
next;
}
rename $tmp, $photo or die "Cannot rename $tmp to $photo: $!\n";
print "... OK\n";
- $meta->{photo}->{$id} = $m;
}
print "Writing meta-data\n";