From: Bastian Dehn Date: Mon, 24 Nov 2025 18:59:49 +0000 (+0100) Subject: change one pdf tiff to pdf convert X-Git-Tag: v1.1.3^2~9 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=0db6b6e333f4027560b6436fafe069fca8878779;p=scantopdf.git change one pdf tiff to pdf convert --- diff --git a/src/scanbasic.sh b/src/scanbasic.sh index e4a9250..f72daef 100644 --- a/src/scanbasic.sh +++ b/src/scanbasic.sh @@ -103,17 +103,10 @@ createonepdf() || errlog "missing output" \ || return $? - local output_pdf= - local tiff= - for tiff in scanned-$$-*.tiff; do - output_pdf=${tiff/.tiff/.pdf} - tiff2pdf $tiff -o $output_pdf \ - || errlog "could not convert tiff to pdf" \ - || return $? - rm $tiff \ - || errlog "could not delete $tiff" \ - || return $? - done + export -f convert_tiff_to_pdf + find scanned-$$-*.tiff \ + | sort \ + | parallel convert_tiff_to_pdf {} pdftk scanned-$$-*.pdf output $output \ || errlog "could not convert into single $output" \ diff --git a/tests/scanbasic.bats b/tests/scanbasic.bats index 31a4c81..41e383e 100755 --- a/tests/scanbasic.bats +++ b/tests/scanbasic.bats @@ -90,17 +90,6 @@ setup() { assert_line --index 0 "❌ ERROR: missing output" } -@test "should failure createonepdf tiff2pdf fails" { - tiff2pdf() { - return 1 - } - - run createonepdf "testfile" - - assert_failure - assert_line --index 0 "❌ ERROR: could not convert tiff to pdf" -} - @test "should failure createonepdf pdftk fails" { tiff2pdf() { : @@ -108,6 +97,9 @@ setup() { rm() { : } + find() { + : + } pdftk() { return 1 }