Skip to content

Instantly share code, notes, and snippets.

@laurynas
Last active March 31, 2018 15:28
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 laurynas/cb996eabc5d5c0e40eac7b0e6f4150ce to your computer and use it in GitHub Desktop.
Save laurynas/cb996eabc5d5c0e40eac7b0e6f4150ce to your computer and use it in GitHub Desktop.
Adjust exif times to preserve sorting for Google Photos (if all photos are set to the same time)
gem 'mini_exiftool'
require 'mini_exiftool'
files = Dir["./*.JPG"].sort
t = Time.parse('2003-08-01 12:00:00 +0300')
files.each_with_index do |file, i|
photo = MiniExiftool.new file
photo.date_time_original = t + i
p file
p photo.date_time_original
photo.save
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment