flieckster has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use Net::FTP; use File::Copy; use File::Basename; use POSIX qw(strftime); use Image::ExifTool 'ImageInfo'; print "#################################\n"; print "#################################\n"; print "#################################\n"; print "#################################\n"; print "#################################\n"; my $sort = "/Users/flieckb/Desktop/psds/"; my $wpf = "/Volumes/photorepos/Weekly_Product_Folders/Tumi/"; my $current = `date +%m/%d/%Y`; chomp $current; chdir( $sort ) or warn "Cant chdir to $sort $!"; my(@sort_list) = glob "*.psd"; my $sortlist = @sort_list; my $exifTool = new Image::ExifTool; chdir ($wpf) or warn "Cant chdir to $wpf $!"; foreach my $file (@sort_list){ my $prefix; my $style; my $view; my @tags = qw(DateTimeOriginal); $exifTool->Options(Duplicates => 0, DateFormat => '%m-%d-%Y'); my $info = $exifTool->ImageInfo($file, \@tags); print "$file\t"; foreach (@tags) { print "$info->{$_}\t"; } print "\n"; # # if ($file =~qr/\A([^_]+)-([^_]+)(?:_([^_]+))?\.([^\.]+)\z/) { # $prefix = $1; # $style = $2; # $view = $3; # # print "prefix $prefix\n"; # print "style $style\n"; # print "view $view\n"; # # my $movelist = "$sort$file"; # if (-d "$style") { # chdir ($style) and print "$style already exsits\n"; # } # else # { # mkdir($style, 0777)and print "$style was created\n"; # chdir ($style); # } # ## # if (-d "$date") { # print "$date already exsits\n"; # copy ($movelist, $date)or warn print "Copy $date Failed: $!\n"; # } # else # { # mkdir($date, 0777); # copy ($movelist, $date)or warn print "Copy $date Failed: $!\n"; # } # chdir ($wpf); # } # else # { # print "did not match expression = $file\n"; # }; };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: date created in exiftool
by roboticus (Chancellor) on Dec 04, 2018 at 14:12 UTC | |
by flieckster (Scribe) on Dec 04, 2018 at 15:17 UTC | |
by hippo (Archbishop) on Dec 04, 2018 at 16:28 UTC | |
Re: date created in exiftool
by bliako (Abbot) on Dec 04, 2018 at 16:33 UTC |