Skip to content
/ exif Public

Automatically fix photo's metadata and upload into Google Photos

Notifications You must be signed in to change notification settings

emmtte/exif

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Photos Metadata Fixer

Automatically fix photo's metadata EXIF and upload into Google Photos

Features

  • Supported photo formats : JPEG and HEIC
  • Automatically delete extra EXIF and fix DateTimeOriginal with directory name if needed
  • Rename photo files with an unique name yyyy-MM-ddThh:mm:ss.(JPEG or HEIC)
  • Create Google Photos Albums with the directory's name yyyy-MM-dd *
  • Upload photos into the appropriate Album
  • Choose either to correct the photo's metadata and upload the photo or only to correct the metadata
  • Photo File deletion after uploading, clean up local files and directories after being uploaded

Prerequisite

Download and Install Node.js

Go to nodejs.org to download and install latest current version

VERSION=13.0.1
sudo apt -y install build-essential
sudo apt -y install libvips #for sharp
wget https://nodejs.org/dist/v$VERSION/node-v$VERSION-linux-armv7l.tar.gz -O node.tar.gz
sudo tar -xvf node.tar.gz --strip 1 -C /usr/local
rm node.tar.gz

Google Photos OAuth2 Authentication

Enable the Google Photos Library API by clicking the ENABLE button

Create a client ID and client secret

  • Open the Google API Console Credentials page.
  • Click Select a project, then NEW PROJECT, and enter a name for the project, and optionally, edit the provided project ID. Click Create.
  • On the Credentials page, select Create credentials, then OAuth client ID.
  • You may be prompted to set a product name on the Consent screen; if so, click Configure consent screen, supply the requested information, and click Save to return to the Credentials screen.
  • Select Other for the Application type, and enter any additional information required.
  • Click Create.
  • On the page that appears, copy the client ID and client secret to the configuration file config.json

Telegram Notification (Optional)

Creating a new bot with BotFather

  • Use the /newbot command to create a new bot. The BotFather will ask you for a name and username, then generate an authorization token for your new bot.
  • The name of your bot is displayed in contact details and elsewhere.
  • The Username is a short name, to be used in mentions and telegram.me links. Usernames are 5-32 characters long and are case insensitive, but may only include Latin characters, numbers, and underscores. Your bot's username must end in ‘bot’.
  • Copy the token to the configuration file config.json
  • Send a dummy message to your new bot
  • Go to following url https://api.telegram.org/bottoken/getUpdates
  • Look for "chat":{"id":
  • Copy the chatid to the configuration file config.json

Installation & Execution

Downloading and installing packages locally

mkdir ~/gp && cd ~/gp
wget https://raw.githubusercontent.com/emmtte/Google-Photos-Metadata-Fixer/master/package.json
npm install
wget https://raw.githubusercontent.com/emmtte/Google-Photos-Metadata-Fixer/master/gp.js

Execution

Please be carreful : use this script with a backup for your photos

Run one of this two command from the location of the packages install directory

  • To correct EXIF Photos : node gp
  • To Upload : node gp upload

MIT License

Copyright © October 1, 2019 emmtte

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Automatically fix photo's metadata and upload into Google Photos

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published