Added new timewarp command to osxphotos #679
RhetTbull
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've added a new
osxphotos timewarp
command in version 0.48.0. This command allows you to batch adjust the date/time/timezone (or any combination of these) of selected photos. Unlike other osxphotos commands,timewarp
directly modifies the Photos database using undocumented features so I recommend you use this with caution and only if you have a full backup. This is a port of a separate tool, photos_time_warp, that I'd previously maintained separately from osxphotos.Why might you need this?
Photos lets you adjust the date/time/timezone of photos in the info panel but you must do this individually for each photo. If you have a number of photos with incorrect information,
osxphotos timewarp
can change them all at once. This can happen for example, if you used a camera with an internal clock which was set incorrectly. It can also happen if the camera's clock was set correctly but you took the photos in one timezone then imported them to your Mac in a different timezone. In this case, Photos uses the timezone of import if the camera did not specify timezone.Examples
Add 1 day to the date of each photo
osxphotos timewarp --date-delta 1
or
osxphotos timewarp --date-delta "+1 day"
Set the date of each photo to 23 April 2020 and add 3 hours to the time
osxphotos timewarp --date 2020-04-23 --time-delta "+3 hours"
or
osxphotos timewarp --date 2020-04-23 --time-delta "+03:00:00"
Set the time of each photo to 14:30 and set the timezone to UTC +1:00 (Central European Time)
osxphotos timewarp --time 14:30 --timezone +01:00
or
osxphotos timewarp --time 14:30 --timezone +0100
Subtract 1 week from the date for each photo, add 3 hours to the time, set the timezone to UTC -07:00 (Pacific Daylight Time) and also use exiftool to update the EXIF metadata accordingly in the original file; use --verbose to print additional details
osxphotos timewarp --date-delta "-1 week" --time-delta "+3 hours" --timezone -0700 --push-exif --verbose
For this to work, you'll need to install the third-party exiftool (https://exiftool.org/) utility. If you use homebrew (https://brew.sh/) you can do this with
brew install exiftool
.Set the timezone to UTC +03:00 for each photo but keep the time the same (that is, don't adjust time for the new timezone)
osxphotos timewarp --timezone 0300 --match-time
Note on timezones and times: In Photos, when you change the timezone, Photos assumes the time itself was correct for the previous timezone and adjusts the time accordingly to the new timezone. E.g. if the photo's time is
13:00
and the timezone isGMT -07:00
and you adjust the timezone one hour east toGMT -06:00
, Photos will change the time of the photo to14:00
. osxphotos timewarp follows this behavior. Using--match-time
allows you to adjust the timezone but keep the same time without adjustment. For example, if your camera clock was correct but lacked timezone information and you took photos in one timezone but imported them to photos in another, Photos will add the timezone of the computer at time of import. You can use osxphotos timewarp to adjust the timezone but keep the time using--match-time
.Compare the date/time/timezone of selected photos with the date/time/timezone in the photos' original EXIF metadata
osxphotos timewarp --compare-exif
Beta Was this translation helpful? Give feedback.
All reactions