Skip to content

A tool for fixing and organizing a Google Takeout photos export.

Notifications You must be signed in to change notification settings

naftalibeder/porte

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Porte

A tool for fixing and organizing a Google Takeout photos export.

Description

When Google Photos generates a backup of a photo library, the resulting photo files are frequently missing important exif data, like timestamps and geolocation. This metadata is placed into adjacent .json files.

Porte uses each file's original metadata, any related metadata file, and the filename itself to output a directory of fixed files containing the most accurate information available.

Features

  • Date handling
    • Copies timestamps, if needed, from any related metadata file.
    • If a date cannot be found in the exif data or a related metadata file, attempts to parse a date from the filename.
    • Uses the earliest date found, avoiding errors like assigning the file-modification date as the capture date.
    • Prefixes files with the capture date, for a chronologically ordered output directory.
  • Geolocation handling
    • Copies geolocation data, if needed, from any related metadata file.
  • File quality
    • Edits image exif data without recompressing files.
    • Edits video exif data and attempts to repackage as .mp4 without re-encoding, for compatibility. Otherwise, simply renames and copies the file.
    • Fixes incorrect extensions based on the actual file data.
    • Preserves original filename in the output filename and exif title tag.
    • Copies files to an output directory, instead of modifying in-place.
  • Understandable output
    • Sorts failed files into a separate folder to inspect manually.
    • Saves a comprehensive log of converting results for each file.
  • Speed
    • Distributes work across available cores.

Known limitations

  • Does not preserve album data.
  • Editing .avi exif data is not currently supported (due to it being unsupported in ffmpeg).
  • Setting date tags on .gif files does not appear to work.
  • Does not find metadata files that exist in a different archive than their corresponding image. (This requires more cleverness than just matching by filename or image title, since there are many duplicate filenames in a large photo library.)

Etymology

Porte comes from the French word emporte, meaning takeout, in the food sense.

Installation

You can either use a prebuilt binary or build from source.

Prebuilt binary

Go to the Releases page and download a binary for the most recent version.

To run the program on macOS, you need to make it executable:

chmod +x ./macos

From source

To build from source, first install these dependencies:

Then, build the project:

go build -o ./porte

Usage

To convert your photos, run:

porte srcpath destpath

where srcpath is any directory containing images or videos, and destpath is the desired output directory.

If destpath is omitted, a directory will be created by concatenating srcpath and _Export.

Development

To run all tests:

go test ./...

Acknowledgments

Thanks to these useful projects: