Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecRust committed Oct 25, 2023
0 parents commit 37e0a04
Show file tree
Hide file tree
Showing 11 changed files with 6,856 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": 2021
},
"env": {
"node": true,
"es6": true
}
}
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
printWidth: 120
overrides:
- files: "*.js"
options:
singleQuote: true
semi: false
15 changes: 15 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hooks": {
"before:init": "npm run lint"
},
"git": {
"commitArgs": ["-S"],
"tagArgs": ["-s"]
},
"npm": {
"publish": true
},
"github": {
"release": true
}
}
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# gphotos-takeout-repair [![CI](https://github.com/AlecRust/gphotos-takeout-repair/actions/workflows/ci.yml/badge.svg)](https://github.com/AlecRust/gphotos-takeout-repair/actions/workflows/ci.yml) [![npm version](https://badge.fury.io/js/gphotos-takeout-repair.svg)](https://badge.fury.io/js/gphotos-takeout-repair)

Transform a Google Photos export (created with [Takeout](https://takeout.google.com/)) into a more useful folder(s) of images.

The output is folder of files (with folder structure retained) suitable for use as a traditional photo library, where there are no JSON files, no "edited" versions, and the files have suitable `Date Created` timestamps.

For example the following files within the source directory:

| Filename | Date Created | Description |
| ------------------- | ------------------- | ----------------------------- |
| IMG_0001-edited.JPG | Takeout export date | Edited version of the file |
| IMG_0001.JPG | Takeout export date | Original version of the file |
| IMG_0001.json | Takeout export date | Metadata information for file |

Will result in the following file output to the destination directory:

| Filename | Date Created | Description |
| ------------ | ---------------------------- | -------------------------- |
| IMG_0001.JPG | "Photo taken" date from JSON | Edited version of the file |

## Features

- Copies files to destination directory using timestamp from the JSON file
- Selects the best version to copy i.e. "edited" version over original
- Retains source directory folder structure to handle Takeout's exporting of albums
- Handles some common Takeout export filename and encoding issues

## Installation

```sh
npm install -g gphotos-takeout-repair
```

## Usage

```sh
gphotos-takeout-repair --src ./unzipped-takeout-dir --dest ./output-dir
```

## Related

- https://github.com/TheLastGimbus/GooglePhotosTakeoutHelper
- https://github.com/mattwilson1024/google-photos-exif
Loading

0 comments on commit 37e0a04

Please sign in to comment.