feat(user/rsync_tranches):Make more granular
[BK-2020-03.git] / user / bkphotorights
old mode 100644 (file)
new mode 100755 (executable)
index a55ab8e..5af038d
@@ -1,9 +1,15 @@
-#!/bin/bash
-# Desc: Apply metadata to photos
-# Usage: bkphotometa.sh [FILE in]
+#!/usr/bin/env bash
+# Desc: Apply metadata to photos with exiftool
+# Usage: bkphotorights [FILE in]
 # Ref/Attrib: [1]. Creative Commons XMP recommendation. (2015). https://wiki.creativecommons.org/wiki/XMP
 #             [2]. Eva, Johannes. (2023-03-30). “How to edit EXIF metadata via the command line with ExifTool”. libre-software.net. https://libre-software.net/linux/edit-metadata-exiftool/
-# Version: 0.0.1
+#             [2]. “XMP Tags”. (2023-06-08). exiftool.org. https://exiftool.org/TagNames/XMP.html
+# Version: 0.2.0
+# Depends: * exiftool 12.16 (https://exiftool.org/ )
+#          * bash 5.1.16
+# Example: bkphotorights DSC00035.JPG
+# Note: Change strCreator, strCreatorURL, strTerms, and strLicenseURL
+#   values that should be added as metadata to the specified photo.
 
 # Adjust me
 strCreator="Steven Baltakatei Sandoval";
@@ -20,10 +26,12 @@ main() {
 
     # Check plumbing
     if [[ ! -f "$1" ]]; then die "FATAL:Not a file:$1"; fi;
+    if ! command -v exiftool 1>/dev/random 2>&1; then
+        die "FATAL:exiftool not available. See https://exiftool.org/ ."; fi;
 
     # Check file
     # Check if exiftool recognizes the file format
-    if ! exiftool -s -FileType "$file_in" 1>/dev/null; then
+    if ! exiftool -s -FileType "$file_in" 1>/dev/random; then
         yell "ERROR:File type not recognized by exiftool:$file_in";
     fi;
     
@@ -53,9 +61,10 @@ main() {
     cmd_args+=("$file_in");
 
     # Execute command
-    "${cmd_args[@]}";
+    must "${cmd_args[@]}";
 }; # main program
 
 main "$@";
 
-
+# Author: Steven Baltakatei Sandoval
+# License: GPLv3+