https://github.com/ansemjo/ocrallmypdf
container image to run ocr processing on all files in inotify-watched directory
https://github.com/ansemjo/ocrallmypdf
Last synced: 6 months ago
JSON representation
container image to run ocr processing on all files in inotify-watched directory
- Host: GitHub
- URL: https://github.com/ansemjo/ocrallmypdf
- Owner: ansemjo
- License: mit
- Created: 2019-08-05T09:31:16.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-03-25T04:38:30.000Z (over 2 years ago)
- Last Synced: 2024-03-25T05:33:07.889Z (over 2 years ago)
- Language: Shell
- Size: 43.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ocrallmypdf
This is a minimal wrapper around the `jbarlow83/ocrmypdf` container which
adds an inotify-based directory watcher and automatically runs OCR processing
on all incoming files in the input directory.
Think of this as a simplified version of [cmccambridge/ocrmypdf-auto](https://github.com/cmccambridge/ocrmypdf-auto),
where `ocrallmypdf` is using the existing tools `incron` and `task-spooler`
to achieve a similar effect.
## USAGE
Use your container runtime of choice and run:
docker run -d \
-v /path/to/input:/input \
-v /path/to/output:/output \
ghcr.io/ansemjo/ocrallmypdf
Existing files in the input directory are not processed. The processing only
triggers on `CLOSE_WRITE` and `MOVED_TO` events.
The container can be customized with a number of environment variables:
| env | description | default |
| --- | ----------- | ------- |
| `INPUT` | watched input directory inside of the container | `/input` |
| `OUTPUT` | output directory for processed file in the container, *be careful not to create an inotify loop by using the same directories!* | `/output` |
| `OCR_OPTIONS` | options passed to `ocrmypdf` command | `--clean --deskew --output-type pdfa --skip-text` |
| `OCR_LANGUAGE` | language used with tesseract (`-l` flag of `ocrmypdf`), missing languages will be installed on startup | `deu+eng` |
| `REMOVE_ORIGINAL` | truthy value whether to remove original input files | `yes` |
| `JOBS` | number of concurrent jobs in task spooler, *using too many at once may lead to ocr timeouts, since `ocrmypdf` uses all cores per process by default* | `1` |