Last active
March 31, 2018 15:28
-
-
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)
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 characters
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