use warnings;
use lib '/home/mj/web/gal2';
-use UCW::Gallery;
+use UCW::Gallery qw(%CF);
use Image::Magick;
use IO::Handle;
UCW::Gallery::LoadConfig;
-my $photo_dir = $UCW::Gallery::CF{'PhotoDir'};
+my $photo_dir = $CF{'PhotoDir'};
my $photo_meta = File::Spec->catfile($photo_dir, 'gallery.meta');
print "Reading meta-data from $photo_meta\n";
-f $photo_meta or die "Cannot load $photo_meta\n";
my $meta = UCW::Gallery::ReadMeta($photo_meta);
-my $cache_dir = $UCW::Gallery::CF{'CacheDir'};
+my $cache_dir = $CF{'CacheDir'};
if (-d $cache_dir) {
print "Deleting old cache directory: $cache_dir\n";
File::Path::remove_tree($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 (@{$UCW::Gallery::CF{'ThumbSizes'}}) {
+for my $t (@{$CF{'ThumbSizes'}}) {
my ($tw, $th) = @$t;
my $thumb_fmt = $tw . 'x' . $th;
print "Generating $thumb_fmt thumbnails\n";