From: Bastian Dehn Date: Fri, 3 Apr 2026 11:11:00 +0000 (+0200) Subject: change multi addocr parameter X-Git-Tag: v1.1.4^2~11 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=2763893c7f9523dd8becbb4725dd10d01b6662e6;p=scantopdf.git change multi addocr parameter --- diff --git a/src/scanbasic.sh b/src/scanbasic.sh index cc8e665..7eeb2a3 100644 --- a/src/scanbasic.sh +++ b/src/scanbasic.sh @@ -68,23 +68,18 @@ optimize() addocr() { local input="$1" - local multi="$2" + local jobs="$2" local output="$input-out" + jobs=${jobs:=1} [ -n "$input" ] \ || errlog "missing input" \ || return $? echo "ℹ️ INFO: adding ocr on file $input" - if [ "$multi" == "true" ]; then - ocrmypdf --quiet --jobs 1 --language deu $input $output \ - || errlog "could not add ocr on $input" \ + ocrmypdf --quiet --jobs $(nproc) --language deu $input $output \ + || errlog "could not add ocr on $input" \ || return $? - else - ocrmypdf --quiet --jobs $(nproc) --language deu $input $output \ - || errlog "could not add ocr on $input" \ - || return $? - fi [ ! -f $output ] && return 0 @@ -187,7 +182,7 @@ createmultipdfs() export -f optimize find . -name "scanned-$$-*.pdf" \ | sort \ - | parallel --keep-order addocr {} true + | parallel --keep-order addocr {} $(nproc) local startcount=1 local endcount=1