Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tesseract calls exit(1) when trying to set an option it doesn't recognise #1520

Closed
vibertk opened this issue Apr 23, 2018 · 3 comments
Closed

Comments

@vibertk
Copy link

vibertk commented Apr 23, 2018

Environment

  • Tesseract Version: 4
  • Commit Number: c0f9699
  • Platform: Windows 32 and 64

Current Behavior:

We are using tesseract as a dll. When reading in a traineddata file that has options at the start we found that tesseract crashes.

Doing some investigation we found that the issue occurs in Params.cpp->ReadParamsFromFp. If the option is not found then the code calls exit(1).

This might be fine when running tesseract as a standalone but when using it as a dll this causes an unpreventable crash.

Expected Behavior:

I would expect that unrecognised options should be ignored (outputting a message if appropriate) and tesseract continues on regardless. At the worst, an exception thrown that can be caught so that the main app can deal with the problem gracefully

Suggested Fix:

Ignore the option and continue

@amitdo
Copy link
Collaborator

amitdo commented Sep 19, 2018

stweil added a commit to stweil/tesseract that referenced this issue Sep 20, 2018
Wrong or old parameters in traineddata files should not terminate
the program, so make that a warning instead of a fatal error.

This fixes issue tesseract-ocr#1520.

Signed-off-by: Stefan Weil <[email protected]>
@stweil
Copy link
Member

stweil commented Sep 20, 2018

Thank you for reporting. This will be fixed with pull request #1920.

@stweil
Copy link
Member

stweil commented Sep 20, 2018

@zdenop, please add label "enhancement".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants