Skip to content

Instantly share code, notes, and snippets.

@erinburns
Last active April 29, 2021 23:49
Show Gist options
  • Save erinburns/3c7952338654997e1de8c9821d7e63bb to your computer and use it in GitHub Desktop.
Save erinburns/3c7952338654997e1de8c9821d7e63bb to your computer and use it in GitHub Desktop.
(Mac) How to preserve privacy by removing metadata from images and videos using Exiftool.

Removing metadata from images and videos (Mac)

1. Install Exiftool

Download Exiftool from their website

OR

If you have Homebrew installed you can install Exiftool by opening the Terminal app and typing the following and hit ENTER:

brew install exiftool

2. View image metadata

Open Finder and locate the image or video file. In the Terminal app, run:

exiftool /path/to/file

Replace "/path/to/file" with the location of the file by dragging and dropping the file from Finder onto the Terminal window to autopopulate the file's path.

When you press Enter you should see the file's metadata. For example you may see things like:

Make                            : Apple
Model                           : iPhone
Software                        : 11.4
Megapixels                      : 0.922
GPS Altitude                    : 899.28 m
GPS Altitude Ref                : Above Sea Level
GPS Latitude                    : [redacted]
GPS Longitude                   : [redacted]
Rotation                        : 90
GPS Position                    : [redacted]

If you're curious as to how accurate the GPS data is, pop it into Google Maps.

3. Remove metadata from a single image/ video file

Exiftool preserves the original image and metadata and adds "_original" to to the file name to denote this. A new file is created with the original filename, however this file will not have any metadata.

Using the same file, remove the metadata by running:

exiftool -all= /path/to/file

Note: there is a space between the = and /path/to/file.

To verify the metadata is really removed, view it by running

exiftool /path/to/file

There will still be some data but items like GPS Latitude should no longer be there.

Option: Remove metadata from a multiple files in a folder

To remove the metadata from all image/video files in a specific folder, you can run:

exiftool -r -all= /path/to/folder

Replace "/path/to/FOLDER" with the location of the folder in the same way as explained in step 2.

Note: there is a space between the = and /path/to/folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment