Created
April 15, 2022 19:21
-
-
Save leonrinkel/d1bb0991a6431db3920fd521c1af219e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: ocr.sh directory | |
find "${1}" -type f \ | |
-iname "*.png" -print0 \ | |
-o -iname "*.jpg" -print0 \ | |
-o -iname "*.jpeg" -print0 | | |
while IFS= read -r -d '' FILE; do | |
DEST="${FILE}.pdf" | |
if [ ! -f "${DEST}" ]; then | |
tesseract "${FILE}" "${FILE}" pdf | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment