Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.