--- scripts/pgallery/src/pgallery.sh 2012/08/29 12:30:35 1.12 +++ scripts/pgallery/src/pgallery.sh 2012/08/29 12:41:06 1.13 @@ -5,7 +5,7 @@ # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return Aron Schlesinger # -# $Paefchen: scripts/pgallery/src/pgallery.sh,v 1.11 2012/08/29 11:21:41 as Exp $ +# $Paefchen: scripts/pgallery/src/pgallery.sh,v 1.12 2012/08/29 12:30:35 as Exp $ # ARG_TITLE="PGallery" @@ -442,7 +442,11 @@ get_exif_ts() { img=$1 date=$($BIN_EXIF --ifd=EXIF --tag=0x9003 -m $img 2> /dev/null) - test "$date" = "" && return 1 + if [ "$date" = "" ] + then + echo "-1" + return 1 + fi date -j -f "%Y:%m:%d %T" "$date" "+%s" } @@ -609,6 +613,16 @@ done echo test $(echo $FLIST | wc -w) -eq 0 && err "error: no image found in \`\`$ARG_DIR''" + +# use exif createtime to order images +FLIST=$( + ( + for file in $FLIST + do + echo "$(get_exif_ts $file) $file" + done + ) | sort -n | awk '{print $2}' +) # find new and to update images FLIST_NEW=