]>
git.scottworley.com Git - picsort/blob - pics-preprocess
9d0b42f06e07357f0f9c20e68d081ca9860f227f
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
15 if (( "$(df -k . | awk 'NR == 2 { print $4 }')" < $MINFREESPACE ));then
16 echo "Out of disk space"
19 if [[ "$f" == *.NEF
]];then
20 for level
in {10.
.30};do
21 mkdir -p {,sm
/}"$level"
22 base
="$(basename "$f")"
23 out
="$level/${base%.NEF}.jpeg"
24 if [[ -s "$out" ]];then
27 exposure
=$(dc <<< "2k $level 4 / 3.5-p") # 10 to 30 -> -1 to 4 in .25 steps
28 pics
-run-ufraw "$exposure" "$f" "$out"
30 if [[ -s "sm/$out" ]];then
31 echo "Skipping sm/$out"
33 convert
"$out" -geometry "x$SMALLHEIGHT" "sm/$out"
37 if [[ -s "sm/$f" ]];then
41 convert
"$f" -geometry "x$SMALLHEIGHT" "sm/$f"