Skip to content

Instantly share code, notes, and snippets.

@ruzickap
Created March 14, 2018 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruzickap/7b705b26ffb02bb858cd3e8269b35911 to your computer and use it in GitHub Desktop.
Save ruzickap/7b705b26ffb02bb858cd3e8269b35911 to your computer and use it in GitHub Desktop.
Simple script for setting Description + Title into JPEG-Exif/Raw-XMP photos
#!/bin/bash -eux
FILES="$*"
SUBJECT_KEYWORDS="active, adventure, backpack, backpacker"
DESCRIPTION="My description"
TITLE="My title"
LICENSE_LINK="https://creativecommons.org/licenses/by-sa/4.0/"
AUTHOR="Petr Ruzicka <petr.ruzicka@gmail.com>"
AUTHOR_URL="https://petr.xvx.cz"
RIGHTS="This work is licensed to the public under the Creative Commons Attribution-ShareAlike (CC BY-SA) license $LICENSE_LINK"
echo "*** Inserting XMP / Exif details"
exiftool -progress -overwrite_original "-filemodifydate<datetimeoriginal#" \
-Artist="$AUTHOR" -Copyright="$RIGHTS" -CopyrightNotice="${AUTHOR}; $LICENSE_LINK" -rights="$RIGHTS" \
-Title="$TITLE" -ImageDescription="$DESCRIPTION" -ObjectName="$TITLE" \
-Description="$DESCRIPTION" -UserComment="$DESCRIPTION" -Caption-Abstract="$DESCRIPTION" \
-XMP-dc:Creator="$AUTHOR" -XMP-xmpRights:Marked="True" -XMP-dc:Rights="$RIGHTS" -xmp:UsageTerms="$RIGHTS" -XMP-cc:AttributionName="$AUTHOR" -XMP-cc:License="$LICENSE_LINK" -XMP-cc:AttributionURL="$AUTHOR_URL" \
-XMP:Description="${DESCRIPTION}" -XMP:Subject="${SUBJECT_KEYWORDS}" -XMP:Title="${TITLE}" \
-XMP-xmp:Keywords="${SUBJECT_KEYWORDS}" \
-XMP-exif:UserComment="${DESCRIPTION}" \
-ext nef -ext orf -ext ori -ext jpg -ext dng $FILES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment