rphoto: IMG -> img.

This commit is contained in:
Christian P. MOMON 2022-07-21 10:34:36 +02:00
parent 13ca6a67c0
commit 98509ed1b8
1 changed files with 8 additions and 4 deletions

View File

@ -27,7 +27,7 @@ doRename()
{ {
local filename=$(basename $1) local filename=$(basename $1)
#echo "$filename" #echo "$filename"
jhead -nIMG%Y%m%d-%H%M%S "$filename" jhead -nimg%Y%m%d-%H%M%S "$filename"
} }
doRenameCarefully() doRenameCarefully()
@ -35,9 +35,13 @@ doRenameCarefully()
local filename=$(basename $1) local filename=$(basename $1)
#echo "$filename" #echo "$filename"
if [[ $filename =~ IMG[12][90][0-9][0-9][01][0-9][0-3][0-9][012][0-9][0-5][0-9][0-5][0-9].* ]]; then if [[ $filename =~ IMG[12][90][0-9][0-9][01][0-9][0-3][0-9][012][0-9][0-5][0-9][0-5][0-9].* ]]; then
local target=${filename:0:11}-${filename:11} local target=img${filename:3:8}-${filename:11}
if [ -e "$target" ]; then
echo "$filename -r> $target ABORT because file already exists."
else
echo "$filename -r> $target" echo "$filename -r> $target"
mv -f "$filename" "$target" mv "$filename" "$target"
fi
elif [[ $(exiftool $filename | grep -c "Date/Time Original") > 0 ]]; then elif [[ $(exiftool $filename | grep -c "Date/Time Original") > 0 ]]; then
#echo "yop $filename" #echo "yop $filename"
doRename "$filename" doRename "$filename"