gali8 / Tesseract-OCR-iOS

Tesseract OCR iOS is a Framework for iOS7+, compiled also for armv7s and arm64.
http://www.nexor.it
MIT License
4.22k stars 949 forks source link

Set absoluteDataPath properly before configuring the engine #410

Open rsenerol opened 5 years ago

rsenerol commented 5 years ago

When using the initializer initWithLanguage:configDictionary:configFileNames:absoluteDataPath: engineMode:) the property absoluteDataPath was not properly set, with the value passed as param, before configuring the engine. This would raise/print the error "ERROR! Can't init Tesseract engine." and not find the tessdata folder.

The fix makes sure that the property absoluteDataPath is correctly set with the value passed in the init and not the default value (main bundle).

rsenerol commented 5 years ago

Seems like this issue was already opened here https://github.com/gali8/Tesseract-OCR-iOS/issues/394

horseshoe7 commented 4 years ago

I’m also having this problem. Does this fix work? The tests above failed?

horseshoe7 commented 4 years ago

I find that until this fix can be merged into the main branch, an easier workaround is to initialize with language = "", then immediately afterwards, set the language to what you want it to be.