]> git.scottworley.com Git - picsort/blame - pics-preprocess
A manually-callable cleanup utility
[picsort] / pics-preprocess
CommitLineData
e18c13a6
SW
1#!/bin/bash
2
cd368e97
SW
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.
e18c13a6 6
9952a1a7 7SMALLHEIGHT=700
e18c13a6
SW
8
9
10for f;do
cd368e97
SW
11 if [[ "$f" == *.NEF ]];then
12 for level in {10..30};do
13 mkdir -p {,sm/}"$level"
14 base="$(basename "$f")"
15 out="$level/${base%.NEF}.jpeg"
1365c024
SW
16 if [[ -s "$out" ]];then
17 echo "Skipping $out"
18 else
19 exposure=$(dc <<< "2k $level 4 / 3.5-p") # 10 to 30 -> -1 to 4 in .25 steps
7e0b085a 20 pics-run-ufraw "$exposure" "$f" "$out"
cd368e97 21 fi
1365c024
SW
22 if [[ -s "sm/$out" ]];then
23 echo "Skipping sm/$out"
24 else
cd368e97
SW
25 convert "$out" -geometry "x$SMALLHEIGHT" "sm/$out"
26 fi
27 done
28 else
1365c024
SW
29 if [[ -s "sm/$f" ]];then
30 echo "Skipping sm/$f"
31 else
bb17aed5 32 mkdir -p sm
cd368e97 33 convert "$f" -geometry "x$SMALLHEIGHT" "sm/$f"
fd69f569 34 fi
cd368e97 35 fi
e18c13a6 36done