mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-01-05 11:41:19 +00:00
Use --gnu in parralell and XX for mktemp
Signed-off-by: Mansour Behabadi <mansour@oxplot.com>
This commit is contained in:
parent
f581a55544
commit
6653066784
4
OCRmyPDF.sh
Normal file → Executable file
4
OCRmyPDF.sh
Normal file → Executable file
@ -210,7 +210,7 @@ fi
|
||||
today=$(date +"%Y%m%d_%H%M")
|
||||
fld=$(basename "$FILE_INPUT_PDF" | sed 's/[.][^.]*$//')
|
||||
prefix="${today}.filename.${fld}"
|
||||
TMP_FLD=`TMPDIR=${TMP} mktemp -d -t "${prefix}"`
|
||||
TMP_FLD=`TMPDIR=${TMP} mktemp -d -t "${prefix}XXXXXXXX"`
|
||||
FILE_TMP="${TMP_FLD}/tmp.txt" # temporary file with a very short lifetime (may be used for several things)
|
||||
FILE_PAGES_INFO="${TMP_FLD}/pages-info.txt" # for each page: page #; width in pt; height in pt
|
||||
FILE_OUTPUT_PDF_CAT="${TMP_FLD}/ocred.pdf" # concatenated OCRed PDF files
|
||||
@ -229,7 +229,7 @@ sed '/^$/d' "$FILE_TMP" | awk '{printf "%04d %s\n", NR, $0}' > "$FILE_PAGES_INFO
|
||||
numpages=`tail -n 1 "$FILE_PAGES_INFO" | cut -f1 -d" "`
|
||||
|
||||
# process each page of the input pdf file
|
||||
parallel -q -k --halt-on-error 1 "$OCR_PAGE" "$FILE_INPUT_PDF" "{}" "$numpages" "$TMP_FLD" \
|
||||
parallel --gnu -q -k --halt-on-error 1 "$OCR_PAGE" "$FILE_INPUT_PDF" "{}" "$numpages" "$TMP_FLD" \
|
||||
"$VERBOSITY" "$LAN" "$KEEP_TMP" "$PREPROCESS_DESKEW" "$PREPROCESS_CLEAN" "$PREPROCESS_CLEANTOPDF" "$OVERSAMPLING_DPI" \
|
||||
"$PDF_NOIMG" "$TESS_CFG_FILES" "$FORCE_OCR" < "$FILE_PAGES_INFO"
|
||||
ret_code="$?"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user