#!/bin/sh
# $Id: setauthor,v 1.10 2025/07/15 01:51:07 grog Exp $
# Set author in specified files
#
if [ "$1" = "-a" ]; then
  AUTHOR=$2
  shift
  shift
fi
if [ "$1" = "-f" ]; then
  OUTFILE=$2
  shift
  shift
fi
if [ "$1" = "-v" ]; then
  VERBOSE=yes
  shift
fi
if [ "$1" = "-Y" ]; then
  AUTHOR="Yvonne Lehey"
  shift
fi
if [ "$AUTHOR" = "" ]; then
  AUTHOR="Greg Lehey"
fi
for i in $*; do
  if [ "$OUTFILE" != "" ]; then
    echo -o $OUTFILE -author=\"$AUTHOR\" -artist=\"$AUTHOR\" -copyright=\"$AUTHOR\" $i
  else
    if [ "$VERBOSE" != "" ]; then 
      echo exiftool -overwrite_original_in_place -author=\"$AUTHOR\" -artist=\"$AUTHOR\" -copyright=\"$AUTHOR\" $i > /dev/tty
    fi
    echo -overwrite_original_in_place -author=\"$AUTHOR\" -artist=\"$AUTHOR\" -copyright=\"$AUTHOR\" $i
  fi
done | by 5 exiftool
exiftime $*
