]> git.scottworley.com Git - picsort/blobdiff - pics-preprocess
I miss ${foo%bar}
[picsort] / pics-preprocess
index 87eca8c4fa17a0d5ba0cc2b1e178e27ca7a1dd3b..fde35d14f9f70630ee8468d5499a8013b8ebdfcb 100755 (executable)
@@ -15,13 +15,17 @@ for f;do
     base="$(basename "$f")"
     out="$level/${base%.NEF}.jpeg"
     exposure=$(dc <<< "2k $level 4 / 3.5-p")  # 10 to 30 -> -1 to 4 in .25 steps
-    ufraw-batch --out-type=jpeg \
-                --green="$GREEN" \
-                --temperature="$TEMPERATURE" \
-                --compression="$JPEGCOMPRESSION" \
-                --exposure="$exposure" \
-                --output="$out" \
-                "$f"
-    convert "$out" -geometry "x$SMALLHEIGHT" "sm/$out"
+    if [[ ! -s "$out" ]];then
+      ufraw-batch --out-type=jpeg \
+                  --green="$GREEN" \
+                  --temperature="$TEMPERATURE" \
+                  --compression="$JPEGCOMPRESSION" \
+                  --exposure="$exposure" \
+                  --output="$out" \
+                  "$f"
+    fi
+    if [[ ! -s "sm/$out" ]];then
+      convert "$out" -geometry "x$SMALLHEIGHT" "sm/$out"
+    fi
   done
 done