Created
October 3, 2014 18:44
-
-
Save solarsailer/0e5ddb802210e9cf0459 to your computer and use it in GitHub Desktop.
Hazel: fix an image `date-modified` with its EXIF original date (for Hazel, in an embedded script).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set("Europe/Paris"); | |
$date = exif_read_data($argv[1],"EXIF"); | |
$date = $date["DateTimeOriginal"]; | |
$time = date_parse_from_format("Y:m:d H:i:s",$date); | |
$time = mktime($time["hour"],$time["minute"],$time["second"],$time["month"],$time["day"],$time["year"]); | |
touch($argv[1],$time,$time); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment