From 8240771409c66f47f2fccec01786952023f04252 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 31 Mar 2019 16:04:34 +0300 Subject: [PATCH] several fixes and tweaks... Signed-off-by: Alex A. Naanou --- scripts/process-archive.sh | 9 +++++++-- ui (gen4)/archive/media/img/my/work/process-archive.sh | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/process-archive.sh b/scripts/process-archive.sh index f845091d..12ba1b5a 100755 --- a/scripts/process-archive.sh +++ b/scripts/process-archive.sh @@ -1,5 +1,8 @@ #!/bin/bash +# XXX get this from /proc/cpuinfo... +THREADS=6 + # TODO make this runnable from anywhere... # - prepend paths with './' only if local/relative @@ -91,7 +94,7 @@ fi echo "Doing: \"$ARCHIVE_ROOT\"" -if [ -z $LOW_RES_PREVIEWS ] ; then +if [ $LOW_RES_PREVIEWS ] ; then RAW_PREVIEW_DIR="hi-res (RAW)" else RAW_PREVIEW_DIR="preview (RAW)" @@ -245,7 +248,9 @@ cd "./${ARCHIVE_ROOT}" # make low-res previews... if [ -z $SKIP_PREVIEWS ] || [ $LOW_RES_PREVIEWS ] ; then - find . -path '*hi-res (RAW)/*.jpg' -exec bash -c 'makepreview "$SIZE" "{}"' \; + #find . -path '*hi-res (RAW)/*.jpg' -exec bash -c 'makepreview "$SIZE" "{}"' \; + find . -path '*hi-res (RAW)/*.jpg' -print0 \ + | xargs -0 -n 1 -P $THREADS -I {} bash -c 'makepreview "$SIZE" "{}"' fi # collect previews to one location... diff --git a/ui (gen4)/archive/media/img/my/work/process-archive.sh b/ui (gen4)/archive/media/img/my/work/process-archive.sh index f845091d..12ba1b5a 100755 --- a/ui (gen4)/archive/media/img/my/work/process-archive.sh +++ b/ui (gen4)/archive/media/img/my/work/process-archive.sh @@ -1,5 +1,8 @@ #!/bin/bash +# XXX get this from /proc/cpuinfo... +THREADS=6 + # TODO make this runnable from anywhere... # - prepend paths with './' only if local/relative @@ -91,7 +94,7 @@ fi echo "Doing: \"$ARCHIVE_ROOT\"" -if [ -z $LOW_RES_PREVIEWS ] ; then +if [ $LOW_RES_PREVIEWS ] ; then RAW_PREVIEW_DIR="hi-res (RAW)" else RAW_PREVIEW_DIR="preview (RAW)" @@ -245,7 +248,9 @@ cd "./${ARCHIVE_ROOT}" # make low-res previews... if [ -z $SKIP_PREVIEWS ] || [ $LOW_RES_PREVIEWS ] ; then - find . -path '*hi-res (RAW)/*.jpg' -exec bash -c 'makepreview "$SIZE" "{}"' \; + #find . -path '*hi-res (RAW)/*.jpg' -exec bash -c 'makepreview "$SIZE" "{}"' \; + find . -path '*hi-res (RAW)/*.jpg' -print0 \ + | xargs -0 -n 1 -P $THREADS -I {} bash -c 'makepreview "$SIZE" "{}"' fi # collect previews to one location...