#!/bin/sh# Copyright 2016 Malte Flender# This file is part of a Malte project.# # This program is free software: you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation version 2 of the License only.# # This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.# # You should have received a copy of the GNU General Public License# along with this program. If not, see <http://www.gnu.org/licenses/>.Copyright_Owner="Malte Flender"File_Path=$1# Errorhandling:# print the actual command and exit if something went wrongedo(){echo"$@"1>&2"$@"||exit1}# If less than 1 arguments are given exitdie(){echo"$@"exit1}[[$# -eq 1]]|| die "not enough arguments"# Say which fileecho$File_Path# Get title and keywords from promptread -e -p "Enter the Title: `echo $'\n> '`" IPTC_Caption
read -e -p "Enter the Keywords: `echo $'\n> '`" IPTC_Keywords
# Remove all (inclusive adobe) metadata from file exept the ICC Profileedo exiftool -overwrite_original -all= --icc_profile:all ${File_Path}edo exiftool -overwrite_original -adobe=${File_Path}# Add IPTC Captionedo exiftool -overwrite_original -m -iptc:headline="${IPTC_Caption}"${File_Path}edo exiftool -overwrite_original -m -iptc:caption-abstract="${IPTC_Caption}"${File_Path}# Add IPTC Keywordsedo exiftool -overwrite_original -m -iptc:keywords="${IPTC_Keywords}"${File_Path}# Add IPTC Copyrightedo exiftool -overwrite_original -m -iptc:CopyrightNotice="${Copyright_Owner}"${File_Path}# Show all tags as result after a blank lineechoedo exiftool -a -u -g1 ${File_Path}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.