Created
February 26, 2010 17:50
-
-
Save jleedev/315952 to your computer and use it in GitHub Desktop.
Timestamps RAZR pictures
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
#!/usr/bin/env ruby | |
Dir["*.jpg"].each do |file| | |
mm,dd,yy,h,m = [0,3,6,9,11].map { |start| file[start,2] } | |
stamp = "20%s-%s-%s %s:%s" % [yy,mm,dd,h,m] | |
`exiv2 -k -Y 20#{yy} -O #{mm} -D #{dd} -a#{h}:#{m} ad "#{file}"` | |
exit $?.exitstatus if $?.exitstatus.nonzero? | |
`touch -d "#{stamp}" "#{file}"` | |
exit $?.exitstatus if $?.exitstatus.nonzero? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment