Skip to content

Instantly share code, notes, and snippets.

@per2jensen
Last active June 15, 2024 16:16
Show Gist options
  • Save per2jensen/6d9eff3399e8bf2c64b5121498cd34ee to your computer and use it in GitHub Desktop.
Save per2jensen/6d9eff3399e8bf2c64b5121498cd34ee to your computer and use it in GitHub Desktop.
Use exiftool to remove most metadata

Introduction

If you upload a photo somewhere, for instance to Flickr as I do, you might not be interested in exposing all the metadata a file contains.

I have started to use the excellent exiftool to manage the metadata exposed on photos that are publicly available.

I came across this excellent webpage, which is a good read.

BEWARE: The example below preserves Artist and CopyRight tags, which might give away your email.

Exiftool usage

I use this command to remove most metadata. The example modifies the file "test.jpg" to only include a subset of the metadata my photos contain.

exiftool -all:all= \
    -tagsfromfile @ \
		-ColorSpaceTags \
		-ICC_Profile \
    -ProfileDecription \
    -exif:ExposureTime \
    -exif:CreateDate \
    -exif:FNumber \
    -exif:ImageSize \
    -LensId \
    -exif:Rights \
    -exif:Title \
    -exif:FocalLength \
    -exif:Subject \
    -exif:ISO \
    -Exif:Artist \
    -Exif:CopyRight \
    -Iptc:By-line \
    -Xmp-dc:all \
    -Xmp-iptcExt:Event \
		-Xmp:CreatorTool \
		-Exif:Software \
    -ProfileDescription test.jpg

Exiftool is also good for adding metadata, like this:

exiftool -Exif:Artist="Per Jensen" test.jpg

# XMP Title
exiftool -Xmp-dc:Title="En title til dette billede" test.jpg

exiftool -Exif:CopyRight="Per Jensen <per2jensen@gmail.com>" test.jpg

# tagging, the -Xmp-dc:Subject field can be used
exiftool -Xmp-dc:Subject="trold sø roskilde" test.jpg

# Tag for "events"
exiftool -Xmp-iptcExt:Event="walk" test.jpg

Darktable

At some point a I will add something like this to darktable's workflow, that would be very nice.

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