Originally created in 2016 for a blog post on how to Add Exif data back to Facebook images Thrown into git & github in 2018 and mashed together with Docker to make it easier to run with dependencies. Modified to use the newly provided JSON format mandated by GDPR in 2018.
This script will go through all photos in all albums and parse data from the relevant json file adding exif data where possible.
No backup is created as part of this script, please make your own. You'll need to request a JSON backup of your photos from Facebook.
Usage (with Docker & linux containers)
- Install Docker
- Clone this repo (or download this code)
- Open a terminal in the repo directory
- Build and tag the image -
docker build -t facebook-data-image-exif .
- Run the script with the correct things passed in:
docker run --rm -it -v //path/to/facebook/export/photos/directory://input facebook-data-image-exif
Usage (without Docker)
- Install PHP - https://secure.php.net/manual/en/install.php
- Download exiftool - http://www.sno.phy.queensu.ca/~phil/exiftool/
- Clone the repo (or copy the script (script.php))
- Setup the 2 environment variables used by the script (or modify the script to add the correct paths)
- Run the script using php