Se você pode instalar o 'phatch', que tem uma boa interface gráfica, eu recomendo este. No entanto, eu não consegui instalá-lo no meu Ubuntu 16.04, mesmo com o patch sugerido.
Por isso, comecei a procurar um substituto para isso. 'ImageMagick' é o que eu uso agora. Ele é executado na linha de comando (CLI) e um arquivo de script é gravado para simplesmente a tarefa. Abaixo está o arquivo de script que eu escrevi. Dê uma olhada e isso pode ajudá-lo. Modifique-o para se adequar à sua necessidade. Teste-o totalmente e você pode copiar seu arquivo de script de versão para o diretório /usr/local/sbin
para facilitar o acesso.
#!/bin/bash
# set destination directory
d_dir=im
# copy the destination directories structure only
# input source directory
s_dir=""
flag=0
until [ $flag == "1" ] ; do
clear
printf "\n"
ls -d */
printf "\nEnter the name of one of the folders above to processed. \n\n"
read s_dir # input source directory
ls -d */ | grep -wq $s_dir && flag=1 || echo printf "\nDirectory not exist!" ; sleep 2
done
printf "\nCreating destination folder(s): ./$d_dir/$s_dir\n"
rsync -avq -f"+ */" -f"- *" ./$s_dir ./$d_dir
#
# Overwrite the existing file(s)?
#
printf "\nOverwrite existing file(s)?\n"
printf "\nPress [Y/y] or [N/n] ... "
tput sc # save the cursor current position
overwrite=""
until [ "$overwrite" = "y" -o "$overwrite" = "n" ] ; do
read -s -n 1 overwrite # printf n "3[K" erase to end of the line
tput rc ; tput cub 1 ; tput el ; tput cuf 1 # restore cursor position, move 1 left, erase to end of the line , move 1 right
printf "$overwrite\b" # \b --backspace
overwrite=$(echo $overwrite | tr 'A-Z' 'a-z') # translate to lower case
done
printf "\n\n"
#
# list file names in associated path
# find source_dir -type f -name \*.[Jj][Pp][Gg]
#
for img in $(find $s_dir -type f -name \*.[Jj][Pp][Gg] 2> /dev/null )
do
if ! [ -f $d_dir/"$img" -a $overwrite = "n" ] ; then
# write and overwrite image file with date stamp
# read exif meta-data from the image file
read ymd hms orient wid leng \
<<< $(identify -format '%[exif:DateTimeOriginal] \
%[exif:Orientation] %[exif:ExifImageWidth] \
%[exif:ExifImageLength]\n' $img)
year=${ymd:0:4}; mon=${ymd:5:2}; day=${ymd:8:2}
hour=${hms:0:2}; min=${hms:3:2}; sec=${hms:6:2}
# calculate the pointsize --- 3.5% of the smaller one --- width or length
if [ "$wid" -gt "$leng" ] ; then
let ptsz=$leng*35/1000 # 35/1000 is from try and error
else
let ptsz=$wid*35/1000
fi
#
# rotate image first according to the orientation
# rotate back(reverse) after process
#
# TopLeft - 1, BottomRight - 3, RightTop - 6, LeftBottom - 8
# 1
# 6 8
# 3
#
case $orient in
"1")
rotate_1st=""
rotate_reverse=""
let tx=$wid/100 # 100 is from try and error
let ty=$leng/120 # 120 is from try and error
;;
"8")
rotate_1st='-rotate -90'
rotate_reverse='-rotate +90'
let tx=50
let ty=50
;;
"3")
# actually, I do not have photo with orientation 3,
# the tx and ty are just wild guess.
rotate_1st='-rotate -180'
rotate_reverse='-rotate +180'
let tx=$wid/100
let ty=$leng/120
;;
"6")
# actually, I do not have photo with orientation 6,
# the tx and ty are just wild guess.
rotate_1st='-rotate +90'
rotate_reverse='-rotate -90'
let tx=50
let ty=50
;;
esac
convert "$img" \
$rotate_1st \
-gravity SouthEast \ # date stamp at bottom right of photo
-pointsize $ptsz \
-fill red \
-font Ubuntu-Mono \
-annotate +"$tx"+"$ty" "@ $hour:$min:$sec\n$year-$mon-$day" \
$rotate_reverse \
$d_dir/"$img"
printf "$d_dir/$img converted.\n"
fi
done
printf "Done! \n"