This commit is contained in:
Peter Molnar 2020-05-31 07:44:08 +01:00 committed by GitHub
commit d239ecd627

26
image.initmeta.sh Normal file
View file

@ -0,0 +1,26 @@
#!/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"