t* Simple Justified Gallery URI git clone git://git.codevoid.de/mkpicindex DIR Log DIR Files DIR Refs DIR README --- DIR commit d4eaaa6952c8350bc660a5a49240e876911dab90 DIR parent 0ae6cf1614cf7dcec320e0e7cef74bc8a4b58235 URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de> Date: Sun, 27 Oct 2019 21:04:28 +0100 Extract previews from RAWs Diffstat: M mkpicindex-static.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) --- DIR diff --git a/mkpicindex-static.sh b/mkpicindex-static.sh t@@ -88,6 +88,12 @@ thread_check() { while [ $(pgrep convert | wc -l | awk '{ print $1 }') -gt $(($THREADS-1)) ]; do console "Process Limit ($THREADS) reached. Waiting..."; sleep 2; done } +# EXTACT CAMERA IMAGE FROM RAW +convert_raw() { + F="$1" # raw image + dcraw -e -c "$F" > "${F%%.*}_preview.jpg" # DCR + # XXX Dcraw may export a PPM file. +} # CREATE THUMBNAIL create_thumb() { t@@ -213,8 +219,10 @@ do if [ -f "$F" ]; then case "$(printf '%s' ${F##*.} | tr '[:upper:]' '[:lower:]')" in - jpg|jpeg|png|gif|cr2|dng|nef) add_image "$F" ;; - *) console "Ignoring: $F" ;; + jpg|jpeg|png|gif) add_image "$F" ;; + cr2|dng|nef) extract_raw "$F" && \ + add_image "${F%%.*}_preview.jpg" ;; + *) console "Ignoring: $F" ;; esac fi done