alpha
Login
or
Join now
j3s.sh
/
dotfiles
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
my dotz
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
ricoh 2.0
author
Jes Olson
date
1 year ago
(Mar 17, 2025, 4:39 PM -0400)
commit
f0e6fd34
f0e6fd34374390ee611bcfdffac483cb30b2876a
parent
75e39114
75e391146eec2ddc19cc234a65fbe2243d46a760
+35
-3
1 changed file
Expand all
Collapse all
Unified
Split
bin
ricoh
+35
-3
bin/ricoh
Reviewed
···
1
1
#!/bin/sh
2
2
3
3
-
mkdir /tmp/ricoh
4
4
-
cd /tmp/ricoh
5
5
-
gphoto2 --auto-detect --get-all-files
3
3
+
die() {
4
4
+
printf '%s: %s.\n' "$(basename "$0")" "$1" >&2
5
5
+
exit 1
6
6
+
}
7
7
+
8
8
+
sudo mount /dev/sda1 /media/ricoh
9
9
+
trap 'sudo umount /media/ricoh' EXIT
10
10
+
11
11
+
# make sure it's da right ting
12
12
+
test -d /media/ricoh/DCIM/101RICOH ||
13
13
+
die "picture dir not found"
14
14
+
15
15
+
ls /media/ricoh/DCIM/101RICOH/*.JPG 2>&1 >/dev/null ||
16
16
+
die "no jpgs found"
17
17
+
18
18
+
# bak that shit up
19
19
+
imgdir="$HOME/Pictures/ricoh/$(date +%Y-%m-%d)"
20
20
+
mkdir -p "$imgdir"
21
21
+
cp /media/ricoh/DCIM/101RICOH/*.JPG "$imgdir"
22
22
+
23
23
+
# convert to ente.io uploadable format
24
24
+
tmpdir="$(mktemp -d /tmp/ricoh_webp.XXXXXX)"
25
25
+
for i in "$imgdir"/*.JPG; do
26
26
+
test -f "$i" ||
27
27
+
die "$i is not a file"
28
28
+
b="$(basename "$i" .JPG)"
29
29
+
ffmpeg -i "$i" \
30
30
+
-c:v libwebp \
31
31
+
-lossless 0 \
32
32
+
-q:v 80 \
33
33
+
-compression_level 6 \
34
34
+
"$tmpdir/$b.webp"
35
35
+
done
36
36
+
37
37
+
printf "%s\n" "$tmpdir"