my dotz
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

ricoh 2.0

+35 -3
+35 -3
bin/ricoh
··· 1 1 #!/bin/sh 2 2 3 - mkdir /tmp/ricoh 4 - cd /tmp/ricoh 5 - gphoto2 --auto-detect --get-all-files 3 + die() { 4 + printf '%s: %s.\n' "$(basename "$0")" "$1" >&2 5 + exit 1 6 + } 7 + 8 + sudo mount /dev/sda1 /media/ricoh 9 + trap 'sudo umount /media/ricoh' EXIT 10 + 11 + # make sure it's da right ting 12 + test -d /media/ricoh/DCIM/101RICOH || 13 + die "picture dir not found" 14 + 15 + ls /media/ricoh/DCIM/101RICOH/*.JPG 2>&1 >/dev/null || 16 + die "no jpgs found" 17 + 18 + # bak that shit up 19 + imgdir="$HOME/Pictures/ricoh/$(date +%Y-%m-%d)" 20 + mkdir -p "$imgdir" 21 + cp /media/ricoh/DCIM/101RICOH/*.JPG "$imgdir" 22 + 23 + # convert to ente.io uploadable format 24 + tmpdir="$(mktemp -d /tmp/ricoh_webp.XXXXXX)" 25 + for i in "$imgdir"/*.JPG; do 26 + test -f "$i" || 27 + die "$i is not a file" 28 + b="$(basename "$i" .JPG)" 29 + ffmpeg -i "$i" \ 30 + -c:v libwebp \ 31 + -lossless 0 \ 32 + -q:v 80 \ 33 + -compression_level 6 \ 34 + "$tmpdir/$b.webp" 35 + done 36 + 37 + printf "%s\n" "$tmpdir"