rphoto: IMG -> img.
This commit is contained in:
parent
13ca6a67c0
commit
98509ed1b8
|
@ -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}
|
||||||
echo "$filename -r> $target"
|
if [ -e "$target" ]; then
|
||||||
mv -f "$filename" "$target"
|
echo "$filename -r> $target ABORT because file already exists."
|
||||||
|
else
|
||||||
|
echo "$filename -r> $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"
|
||||||
|
|
Loading…
Reference in New Issue