/Google-Photos-Fixer

Python scripts to restore EXIF data of media files using .json files provided by Google Photos Takeout, also restore EXIF data of files with no .json files.

Primary LanguagePython


πŸš€ Google Photos Fixer

Python scripts to restore EXIF data of media files using .JSON files provided by Google Photos Takeout.

πŸ› οΈ Requirements

  • General:

    • Python 3.7+
    • pip (Python package installer)
  • For Debian-based systems:

    sudo apt update
    sudo apt install python3-full python3-pip exiftool
    pip3 install Pillow pyexiftool
  • For Arch-based systems:

    sudo pacman -Syu
    sudo pacman -S python-full python-pip exiftool
    pip install Pillow pyexiftool

πŸ“₯ Downloading Google Photos Takeout

  1. Go to Google Takeout.
  2. Select the data you want to download. Make sure to include β€œGoogle Photos.”
  3. Choose your export options and click "Next."
  4. Click "Create export" and wait for the process to complete.
  5. Download the ZIP file containing your data.

πŸ“‚ Extracting Takeout Data

  1. Move the downloaded ZIP file to your preferred directory, e.g., ~/Downloads.
  2. Extract the ZIP file to ~/takeout:
    mkdir -p ~/takeout
    unzip ~/Downloads/your_takeout_file.zip -d ~/takeout

πŸ“œ Usage

  1. Clone the repository:

    git clone https://github.com/postcumer/Google-Photos-Fixer
    cd Google-Photos-Fixer
  2. Run the scripts:

    python3 process_images.py
    python3 extract_dates.py
    python3 sorting.py (optional)
    python3 check_no_of_processed_images.py (optional)

πŸ› οΈ Troubleshooting

If the script doesn't work due to security issues, try running it in a Python virtual environment:

  1. Create a virtual environment:

    python3 -m venv myenv
  2. Activate the virtual environment:

    source myenv/bin/activate
  3. Install the required packages:

    pip install pyexiftool Pillow
  4. Run the scripts within the virtual environment.

πŸ“ License

This project is licensed under the MIT License. See the LICENSE file for details.