Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RhetTbull

macrumors member
Original poster
Apr 18, 2022
99
73
Los Angeles, CA
I'm the author of the free open-source tool osxphotos which provides command line utilities for importing photos, exporting photos, batch edits, etc. As of version v0.67.0, the osxphotos import command now supports importing files and metadata from a Google Takeout archive into Photos along with preserving all metadata and albums.

For example, to import a Google Takeout archive into Photos.app:

- Install osxphotos using these instructions.

- Download the Google Photos Takeout archive from Google and unzip it. This will create a folder with a name like `Takeout`. Inside this folder will be a folder named `Google Photos` which contains all the photos and videos and JSON sidecar files for each file. You can import the photos and videos into Photos.app using the following command (assuming you unzipped the Takeout file in your Downloads folder):

Bash:
osxphotos import ~/Downloads/Takeout/Google\ Photos --walk --album "{filepath.parent.name}" --skip-dups --dup-albums --sidecar --verbose --sidecar-ignore-date --keyword "{person}" --report takeout_import.csv

This will import all the photos and videos into Photos.app, creating albums with the same name as the folder they were contained in within the Takeout archive (which is how Google Takeout stores photos in albums). It will skip duplicates (Google Takeout exports duplicate copies of photos that are in more than one album) but add the duplicate photo that's already been imported to Photos to the albums it would have been added to if it were imported again (`--skip-dups --dup-albums`). It will also import metadata from the sidecar files (Google Takeout exports metadata in JSON format) (`--sidecar`).

The `--sidecar-ignore-date` option is optional but prevents osxphotos from setting the photo's date from the sidecar metadata. This is helpful because Google Takeout does not preserve the timezone of the photo in the Takeout metadata but converts all times to UTC. This will be handled by osxphotos by converting to local timezone upon import. However, if the photo's already have correct time in the EXIF data, `--sidecar-ignore-date` will prevent osxphotos from setting the date from the sidecar metadata, allowing Photos to set the date from the image. If you changed a lot of photo dates/times in Google Photos or this information is not contained in the assets uploaded to Google Photos, then omit the `--sidecar-ignore-date` option and osxphotos will set the date/time from the Google Takeout metadata file.

The `--keyword "{person}"` option will add any people in the photo to the photo's keywords. The `osxphotos import` command cannot set person info in Photos (this is a limitation of Photos) but Google will preserve the person names if you've used the face naming feature. You can optionally include `--keyword "{person}"` to add keywords for the persons found in each image.

The `--report takeout_import.csv` option will create a report of the import in CSV format that can be opened in Google Sheets, Excel, Numbers, TextEdit, etc.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.