]>
git.scottworley.com Git - picsort/blob - pics-preprocess
ec66abfb9bd3550838be67276c99d793649a8ce1
3 # Pass .NEF and .jpeg files as $@.
4 # This makes many variants of each .NEF file at different exposure levels
5 # and makes reduced-size versions for faster browsing.
7 MINFREESPACE
=$((10 * 1024 * 1024)) # 10GiB in KiB
14 if (( "$(df -k . | awk 'NR == 2 { print $4 }')" < $MINFREESPACE ));then
15 echo "Out of disk space"
18 if [[ "$f" == *.NEF
]];then
19 for level
in {10.
.30};do
20 mkdir -p {,sm
/}"$level"
21 base
="$(basename "$f")"
22 out
="$level/${base%.NEF}.jpeg"
23 if [[ -s "$out" ]];then
26 exposure
=$(dc <<< "2k $level 4 / 3.5-p") # 10 to 30 -> -1 to 4 in .25 steps
27 pics
-run-ufraw "$exposure" "$f" "$out"
29 if [[ -s "sm/$out" ]];then
30 echo "Skipping sm/$out"
32 convert
"$out" -geometry "x$SMALLHEIGHT" "sm/$out"
36 if [[ -s "sm/$f" ]];then
40 convert
"$f" -geometry "x$SMALLHEIGHT" "sm/$f"