ocrmypdf / OCRmyPDF

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched
http://ocrmypdf.readthedocs.io/
Mozilla Public License 2.0
13.7k stars 999 forks source link

Trying to debug OCR_ON_SUCCESS_DELETE flag not being executed - add exit code to watcher.py? #1256

Closed wabarkley closed 7 months ago

wabarkley commented 7 months ago

Describe the bug

OCR works fine when running watcher.py as a Docker container on Synology NAS, but the input file isn't being deleted after processing. DEBUG level logging is turned on, but the exit_code value isn't returned in the log file to understand why the watcher.py doesn't traverse the path that actually deletes or archives the input (exit_code value must not be 0, but I don't know which value it actually is.)

Could you add the ocrmypdf exit code to the DEBUG output at line 131 of watcher.py? https://github.com/ocrmypdf/OCRmyPDF/blob/59d5b0d1bd781f21be0fdea02ff0d2b841bc067e/misc/watcher.py#L131C26-L131C30

Steps to reproduce

1. Run ocrmypdf as described in the instructions for Hot (watched) folders, setting the OCR_ON_SUCCESS_DELETE=1 and OCR_LOGLEVEL=DEBUG
2. place file in the input folder
3. OCR'd pdf exists in the output folder
4. original file remains in the input folder

Files

No response

How did you download and install the software?

No response

OCRmyPDF version

No response

Relevant log output

No response

jbarlow83 commented 7 months ago

Possibly same issue #1258 - have a look at that and see if it helps

wabarkley commented 7 months ago

Same issue, thanks. Pulled the latest tag with this fix and it's working again.