]> mj.ucw.cz Git - gallery.git/blobdiff - gal2/gal-scan
Gallery2: More renames
[gallery.git] / gal2 / gal-scan
index 951a93c646376f9d6908e4da3ec2704986f171c3..2cccfe13c82c6f4e2cdc373cef03eb146c497bbb 100755 (executable)
@@ -5,8 +5,9 @@
 use strict;
 use warnings;
 
-use lib '/home/mj/web/gal2';
-use UCW::Gallery;
+use FindBin;
+use lib $FindBin::Bin;
+use UCW::Gallery qw(%CF);
 
 use File::Spec;
 use Image::EXIF;
@@ -29,7 +30,7 @@ if (@ARGV) {
                        my @p = ();
                        while (my $e = readdir D) {
                                my $f = File::Spec->canonpath(File::Spec->catfile($in, $e));
-                               if ($f =~ m{\.jpe?g$}i) {
+                               if ($f =~ m{\.(jpe?g|png)$}i) {
                                        push @p, $f;
                                }
                        }
@@ -47,7 +48,7 @@ if (@ARGV) {
 }
 
 UCW::Gallery::LoadConfig;
-my $orig_prefix = $UCW::Gallery::CF{'OrigDir'};
+my $orig_prefix = $CF{'OrigDir'};
 $orig_prefix =~ m{/$} or $orig_prefix .= '/';
 
 print "Scanning photos\n";
@@ -82,7 +83,7 @@ foreach my $f (@files) {
                        file => $rel_name,
                        id => $id,
                        orientation => $o,
-                       xfrm => $UCW::Gallery::CF{'ScanDefaultTransform'},
+                       xfrm => $CF{'ScanDefaultTransform'},
                        title => '',
                };
                print "ori=$o\n";