Last active
September 3, 2020 21:09
-
-
Save petermolnar/244316be6a739815644542865fa82185 to your computer and use it in GitHub Desktop.
set image license and right metadata to please Google
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "Use: image.initmeta PHOTO" | |
exit 1 | |
fi | |
year="$(exiftool -s -EXIF:DateTimeOriginal "$1" | awk '{print $3}' | cut -d":" -f1)" | |
artist="Peter Molnar" | |
rights="CC BY-NC-ND 4.0 ${year} ${artist} <mail@petermolnar.net>" | |
url="https://petermolnar.net/" | |
email="mail@petermolnar.net" | |
licenseurl="https://spdx.org/licenses/CC-BY-NC-ND-4.0.html" | |
exiftool\ | |
-EXIF:Artist="${artist}"\ | |
-EXIF:Copyright="${rights}"\ | |
-IPTC:By-line="${artist}"\ | |
-IPTC:CopyrightNotice="${rights}"\ | |
-XMP:CopyrightOwnerID="${url}"\ | |
-XMP:CopyrightOwnerName="${artist}"\ | |
-XMP:Creator="${artist}"\ | |
-XMP:Rights="${rights}"\ | |
-xmp-plus:Licensor="{LicensorID=${url},LicensorName=${artist},LicensorURL=${url},LicensorEmail=${email}}"\ | |
-xmp-xmpRights:WebStatement="${licenseurl}"\ | |
"$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment