2 # Scan images in a list or gqview collection and prepare them for gal-gen
3 # (c) 2004--2007 Martin Mares <mj@ucw.cz>
22 die "Parse error: $_";
27 foreach my $f (@pics) {
28 my $e = new Image::EXIF($f);
29 my $i = $e->get_all_info();
30 if ($e->error) { print STDERR "EXIF error on $f: ", $e->error, "\n"; }
32 #print STDERR Dumper($i), "\n";
33 my $o = $i->{'image'}->{'Image Orientation'} || "Top, Left-Hand";
34 if ($o eq "Top, Left-Hand") { $o = "."; }
35 elsif ($o eq "Right-Hand, Top") { $o = "r"; }
36 elsif ($o eq "Left-Hand, Bottom") { $o = "l"; }
37 elsif ($o eq "Bottom, Right-Hand") { $o = "d"; }
39 print STDERR "Unrecognized orientation: $o\n";
42 my $d = $i->{'image'}->{'Image Created'} || "?";
44 $d =~ s/^(\d{4}):(\d{2}):(\d{2}) (\d{2}:\d{2}:\d{2})/$1-$2-$3 $4/ or die "Date parse error: $d";
46 print "$f\t$d\t$o\tn\n";