diff --git a/Convention photos/Traitements/rphoto b/Convention photos/Traitements/rphoto index b37abaa..d3fb02d 100755 --- a/Convention photos/Traitements/rphoto +++ b/Convention photos/Traitements/rphoto @@ -27,7 +27,7 @@ doRename() { local filename=$(basename $1) #echo "$filename" - jhead -nIMG%Y%m%d-%H%M%S "$filename" + jhead -nimg%Y%m%d-%H%M%S "$filename" } doRenameCarefully() @@ -35,9 +35,13 @@ doRenameCarefully() local filename=$(basename $1) #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 - local target=${filename:0:11}-${filename:11} - echo "$filename -r> $target" - mv -f "$filename" "$target" + 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" + mv "$filename" "$target" + fi elif [[ $(exiftool $filename | grep -c "Date/Time Original") > 0 ]]; then #echo "yop $filename" doRename "$filename"