2 # Merge photos from multiple sources
3 # (c) 2008 Martin Mares <mj@ucw.cz>
24 foreach my $f (@pics) {
25 my $e = new Image::EXIF($f);
26 my $i = $e->get_all_info();
27 if ($e->error) { print STDERR "EXIF error on $f: ", $e->error, "\n"; }
29 #print STDERR Dumper($i), "\n";
30 my $o = $i->{'image'}->{'Image Orientation'} || "Top, Left-Hand";
31 if ($o eq "Top, Left-Hand") { $o = "."; }
32 elsif ($o eq "Right-Hand, Top") { $o = "r"; }
33 elsif ($o eq "Left-Hand, Bottom") { $o = "l"; }
34 elsif ($o eq "Bottom, Right-Hand") { $o = "d"; }
36 print STDERR "Unrecognized orientation: $o\n";
39 my $d = $i->{'image'}->{'Image Created'};
41 $d =~ s/^(\d{4}):(\d{2}):(\d{2}) (\d{2}):(\d{2}):(\d{2})/$1$2$3-$4$5$6/ or die "Date parse error: $d";
43 print STDERR "Unrecognized data, skipping: $f\n";
47 if ($f =~ m{^\.\./orig/(\w+)/}) {
50 if (defined $seen{$fn}) {
56 print "ln -s '$f' '$fn.jpg'\n";