zapolnoch / node-tesseract-ocr

A Node.js wrapper for the Tesseract OCR API
MIT License
304 stars 38 forks source link

cmd fail when filename contains spaces (Windows) #9

Closed FirstVertex closed 4 years ago

FirstVertex commented 5 years ago

Input directory is C:\Users\rc08281\code\code-challenges\ocr\work\input Found 1 files in input directory { Error: Command failed: tesseract C:\Users\rc08281\code\code-challenges\ocr\work\converted\WI -Exemption -Invalid -Handwritten.png stdout -c 0=e -c 1=n -c 2=g read_params_file: Can't open stdout read_params_file: Can't open c read_params_file: Can't open 0=e read_params_file: Can't open c read_params_file: Can't open 1=n read_params_file: Can't open c read_params_file: Can't open 2=g Could not set option: 0=e Could not set option: 1=n Could not set option: 2=g Tesseract Open Source OCR Engine v4.00.00alpha with Leptonica Error in fopenReadStream: file not found Error in findFileFormat: image file not found Error during processing.

The filename is "WI -Exemption -Invalid -Handwritten.png"

Can you please enclose it in quotes when you spawn convert?

pontuslaestadius commented 4 years ago

This was an issue with the other node-tesseract project as well. My workaround is to enclose whatever path I have in strings: path = "${path}" If this project is still active, this should be easy to resolve.

zapolnoch commented 4 years ago

Fixed in 2.0 release