Last active
August 29, 2015 14:01
-
-
Save mattpolito/aa3b65721e0412c8bce4 to your computer and use it in GitHub Desktop.
Revisions
-
mattpolito revised this gist
May 12, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ # Converted files receive original file's EXIF data, but not file creation date. # That date is set to whenever you created the converted file. # Usage: `> ruby update_file_creation_date.rb ~/Pictures/converted_files/*.*` files = ARGV files.each do |file| -
mattpolito revised this gist
May 12, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,8 @@ # Converted files receive original file's EXIF data, but not file creation date. # That date is set to whenever you created the converted file. # Usage: `> ruby update_file_creation_date.rb ~/Pictures/converted_files/*.* files = ARGV files.each do |file| if file.match(/jpg/) -
mattpolito created this gist
May 12, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #! /usr/bin/ruby # requires exiftool: `brew install exiftool` # Used to update file creation dates when converting RAW photos to JPG # Converted files receive original file's EXIF data, but not file creation date. # That date is set to whenever you created the converted file. files = ARGV files.each do |file| if file.match(/jpg/) puts "*** #{file_path}" timestamp = %x[exiftool #{file_path} -DateTimeOriginal -d %Y%m%d%H%M | awk '{print $4}'].strip %x[touch -t #{timestamp} #{file_path}] end end