Skip to content

Instantly share code, notes, and snippets.

@jleedev
Created February 26, 2010 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jleedev/315952 to your computer and use it in GitHub Desktop.
Save jleedev/315952 to your computer and use it in GitHub Desktop.
Timestamps RAZR pictures
#!/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