#!/usr/bin/perl

@files = `find -name \*.jpg`;

foreach (@files) {

	chomp;

	$orig = `exiftime -td $_`;
	chomp $orig;

	$orig =~ m/^Image Digitized: (\d\d\d\d):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)/;
	$year = $1;
	$month = $2;
	$day = $3;
	$hour = $4;
	$minute = $5;
	$second = $6;

	system "exiftime -w -f -v${year}y -v${month}m -v${day}d -v${hour}H -v${minute}M -v${second}S $_";

}
