home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit f38da894e7e7c8109197477eb06ee171ba48d241
parent 27d5499e6f8f4f56471ad8c896c84094545e0aba
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Fri, 14 Sep 2018 13:24:05 +0200

Update import-google-photo script

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Apkgs/scripts/bin/import-google-photo | 25+++++++++++++++++++++++++
Dpkgs/scripts/bin/import-google-photo.sh | 1-
2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/pkgs/scripts/bin/import-google-photo b/pkgs/scripts/bin/import-google-photo @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -e + +SRCDIR=$1 +shift +DSTDIR=$1 +shift + +echo "Import photos from $SRCDIR to $DSTDIR" +echo "-------------------------------------" + +TMPDIR=$HOME/tmp/google-photo-import +mkdir -p $TMPDIR + +# 1. Copy folder to a safe place +rsync -av --progress --size-only "$SRCDIR" "$TMPDIR" --delete +# trap "rm -rf -- '$TMPDIR'" INT TERM EXIT + +# 2. Run exiftool :) +exiftool -r -d $DSTDIR/%Y/%m/%d/%f.%%le '-filename<CreateDate' \ + -ext jpg -ext JPG -ext jpeg -ext JPEG -ext jpe -ext JPE \ + -ext 3gp -ext 3GP -ext mov -ext MOV -ext avi -ext AVI -ext mpg -ext MPG \ + -ext nef -ext NEF -ext mts -ext MTS \ + -ext HEIC -ext heic "$TMPDIR" diff --git a/pkgs/scripts/bin/import-google-photo.sh b/pkgs/scripts/bin/import-google-photo.sh @@ -1 +0,0 @@ -#!/usr/bin/env bash