Skip to content

Instantly share code, notes, and snippets.

@martin-v
Last active December 16, 2015 10:59
Show Gist options
  • Save martin-v/5424217 to your computer and use it in GitHub Desktop.
Save martin-v/5424217 to your computer and use it in GitHub Desktop.
useful exiftool snippets
#!/usr/bin/sh
# Show all relevant tags from file
exiftool -args -a -u -e -f -G1:2 test.jpg | grep -v "\-File" | grep -v "\-System"
# Remove all except some white listed useful tags
exiftool -all= -tagsFromFile @ -XMP-dc:Rights -XMP-dc:Creator -XMP-dc:Publisher -ExifIFD:ExposureTime -ExifIFD:FNumber -ExifIFD:ISO -ExifIFD:ExifVersion -ExifIFD:Flash -ExifIFD:FocalLength -ExifIFD:ColorSpace -ExifIFD:FocalLengthIn35mmFormat -IFD0:Artist -IFD0:Copyright -IFD0:Make -IFD0:Model -v0 -progress -overwrite_original
# Add my copyright informations
MY_NAME="Some One"
LICENCE_LINK="https://creativecommons.org/licenses/by-sa/4.0/"
COPYRIGHT_TEXT="© $MY_NAME ; Lizenz: Creative Commons Attribution 4.0 International ($LICENCE_LINK)"
exiftool -by-line="$MY_NAME" -Artist="$MY_NAME" -Copyright="$COPYRIGHT_TEXT" -CopyrightNotice="$COPYRIGHT_TEXT" -XMP-cc:License="$LICENCE_LINK" -v0 -progress -overwrite_original
# both combined
exiftool -all= -tagsFromFile @ -XMP-dc:Rights -XMP-dc:Creator -XMP-dc:Publisher -ExifIFD:ExposureTime -ExifIFD:FNumber -ExifIFD:ISO -ExifIFD:ExifVersion -ExifIFD:Flash -ExifIFD:FocalLength -ExifIFD:ColorSpace -ExifIFD:FocalLengthIn35mmFormat -IFD0:Artist -IFD0:Copyright -IFD0:Make -IFD0:Model -by-line="$MY_NAME" -Artist="$MY_NAME" -Copyright="$COPYRIGHT_TEXT" -CopyrightNotice="$COPYRIGHT_TEXT" -XMP-cc:License="$LICENCE_LINK" -v0 -progress -overwrite_original
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment