X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=blobdiff_plain;f=archivepics.sh;h=40ad62d2e0e08225d1285f60182fb0bdf36c0869;hp=afaf5d4c8e7701be5ba061ba8b8b5b9400d36d3d;hb=e34107eafa0bdd9c841cd7f84952937bc75c457b;hpb=78d6c0bc5fb5033c2ad8235fac4f2da27230850f diff --git a/archivepics.sh b/archivepics.sh index afaf5d4..40ad62d 100755 --- a/archivepics.sh +++ b/archivepics.sh @@ -28,6 +28,14 @@ [[ ${archive_size_min} ]] || archive_size_min=1048576 # 1Mb +# if [[ -z $* ]] && [[ ${PHO_NOTE_1} ]]; then + # echo "$0 ${PHO_NOTE_1}" + # $0 ${PHO_NOTE_1} + # exit 0 +# fi + +export ARCHIVED_PICS="$@" + set -e if [[ ! ${IMAGE_ARCHIVE_DIR} ]]; then @@ -39,7 +47,7 @@ fi for i in "$@"; do - if [[ ! -f ${i/JPG/MOV} ]]; then + if [[ ! -f ${i/JPG/MOV} ]] && [[ ! -f ${i/JPG/3gp} ]]; then if [[ $(stat --printf=%s $i) -lt ${archive_size_min} ]]; then echo "Image $i is too small." @@ -54,7 +62,13 @@ done for i in "$@"; do - ref=${i/MOV/JPG} + base=${i/%.???/} + + if [[ -f ${base}.JPG ]]; then ref=${base}.JPG; fi + if [[ -f ${base}.jpg ]]; then ref=${base}.jpg; fi + if [[ -f ${base}.jpeg ]]; then ref=${base}.jpeg; fi + + # echo "ref=${ref}" if [[ -f ${ref} ]]; then