Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 23 lines (18 sloc) 446 Bytes
#!/usr/bin/perl
$dir = shift @ARGV || ".";
$dir =~ s/ /\\ /g;
@FILES = sort glob "$dir/*.*";
@IMAGES = grep { /\.(jpe?g)/i } @FILES;
my $imageRef = shift @IMAGES;
if (! -f $imageRef) {
print STDERR "-F|No images found to take timestamp from.\n";
die;
}
for my $file (@FILES) {
if ($file =~ /\.(jpe?g)$/i) {
$imageRef = $file;
}
if ($file =~ /.mov$/i) {
system("touch -mac -r '$imageRef' '$file'");
}
}