it* Simple Justified Gallery Err codevoid.de 70 i Err codevoid.de 70 hgit clone git://git.codevoid.de/mkpicindex URL:git://git.codevoid.de/mkpicindex codevoid.de 70 1Log /git/mkpicindex/log.gph codevoid.de 70 1Files /git/mkpicindex/files.gph codevoid.de 70 1Refs /git/mkpicindex/refs.gph codevoid.de 70 1README /git/mkpicindex/file/README.gph codevoid.de 70 i--- Err codevoid.de 70 1commit 21fdd342a6e45db9dd108aa142135e576d419d72 /git/mkpicindex/commit/21fdd342a6e45db9dd108aa142135e576d419d72.gph codevoid.de 70 1parent 85a559f02548b1e9984507779974c92b185c0e2a /git/mkpicindex/commit/85a559f02548b1e9984507779974c92b185c0e2a.gph codevoid.de 70 hAuthor: Stefan Hagen URL:mailto:sh+git[at]codevoid[dot]de codevoid.de 70 iDate: Sun, 27 Oct 2019 22:03:35 +0100 Err codevoid.de 70 i Err codevoid.de 70 iRemove leftover awk. Err codevoid.de 70 i Err codevoid.de 70 iDiffstat: Err codevoid.de 70 i M mkpicindex-static.sh | 16 +++++++--------- Err codevoid.de 70 i Err codevoid.de 70 i1 file changed, 7 insertions(+), 9 deletions(-) Err codevoid.de 70 i--- Err codevoid.de 70 1diff --git a/mkpicindex-static.sh b/mkpicindex-static.sh /git/mkpicindex/file/mkpicindex-static.sh.gph codevoid.de 70 it@@ -19,7 +19,7 @@ THUMB_PADDING="6" # image padding Err codevoid.de 70 i Err codevoid.de 70 i # TECHNICAL STUFF Err codevoid.de 70 i DEBUG=0 # debug output Err codevoid.de 70 i-THREADS=8 Err codevoid.de 70 i+PROCS=8 Err codevoid.de 70 i Err codevoid.de 70 i # PRINT HELP / USAGE TEXT Err codevoid.de 70 i usage() { Err codevoid.de 70 it@@ -50,7 +50,7 @@ do Err codevoid.de 70 i h) ROW_HEIGHT="$OPTARG" ;; Err codevoid.de 70 i q) QUALITY="$OPTARG" ;; Err codevoid.de 70 i b) THUMB_PADDING="$OPTARG" ;; Err codevoid.de 70 i- p) THREADS="$OPTARG" ;; Err codevoid.de 70 i+ p) PROCS="$OPTARG" ;; Err codevoid.de 70 i d) DEBUG=1 ;; Err codevoid.de 70 i ?|*) usage; ;; Err codevoid.de 70 i esac Err codevoid.de 70 it@@ -78,17 +78,15 @@ get_width_by_height() { Err codevoid.de 70 i # returns aspect ratio calculated width Err codevoid.de 70 i local F="$1" # image file Err codevoid.de 70 i local TH="$2" # target height Err codevoid.de 70 i- local WH="$(identify -format ' %w %h ' "$1" | awk '{ printf("%.0f %.0f",$1,$2) }')" Err codevoid.de 70 i- local W="$(printf "$WH" | awk '{ print $1 }')" Err codevoid.de 70 i- local H="$(printf "$WH" | awk '{ print $2 }')" Err codevoid.de 70 i- local R="$(printf "$WH" | awk -vTH=$TH '{ printf("%.0f", TH*($1/$2)) }')" Err codevoid.de 70 i+ local R="$(identify -format ' %w %h ' "$1" | awk -vTH=$TH \ Err codevoid.de 70 i+ '{ printf("%.0f", TH*($1/$2)) }')" Err codevoid.de 70 i printf '%.0f' "$R" Err codevoid.de 70 i- debug "get_width_by_height: FILE=$F TARGET_HEIGHT=$TH FILE_WxH=$WH RET_WIDTH=$R" Err codevoid.de 70 i+ debug "get_width_by_height: FILE=$F TARGET_HEIGHT=$TH RET_WIDTH=$R" Err codevoid.de 70 i } Err codevoid.de 70 i # TOO MANY CONVERT PROCSSES => WAIT Err codevoid.de 70 i thread_check() { Err codevoid.de 70 i- while [ $(pgrep convert | wc -l | awk '{ print $1 }') -gt $(($THREADS-1)) ]; Err codevoid.de 70 i- do console "Process Limit ($THREADS) reached. Waiting..."; sleep 2; done Err codevoid.de 70 i+ while [ $(pgrep convert | wc -l | awk '{ print $1 }') -gt $(($PROCS-1)) ]; Err codevoid.de 70 i+ do console "Process Limit ($PROCS) reached. Waiting..."; sleep 2; done Err codevoid.de 70 i } Err codevoid.de 70 i # EXTACT CAMERA IMAGE FROM RAW Err codevoid.de 70 i convert_raw() { Err codevoid.de 70 .