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

Fix loading of sublangs (regression) #4141

Merged
merged 1 commit into from
Oct 5, 2023
Merged

Conversation

stweil
Copy link
Contributor

@stweil stweil commented Oct 5, 2023

Model files which where defined with tessedit_load_sublangs in another model file where no longer loaded since Tesseract release 5.0.0-rc2.

Fixes: 9091055 ("Fix loading of additional model files")

@@ -308,7 +308,8 @@ int Tesseract::init_tesseract(const std::string &arg0, const std::string &textba
// Load the rest into sub_langs_.
// A range based for loop does not work here because langs_to_load
// might be changed in the loop when a new submodel is found.
for (auto &lang_to_load : langs_to_load) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have read my own comment which said that using a range based loop is a bad idea here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL, but seriously, maybe you should add WARNING: in the start of the comment line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Done now.

Model files which where defined with tessedit_load_sublangs in another
model file where no longer loaded since Tesseract release 5.0.0-rc2.

Fixes: 9091055 ("Fix loading of additional model files")
Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil stweil merged commit d366e1e into tesseract-ocr:main Oct 5, 2023
5 of 6 checks passed
@stweil stweil deleted the fix_sublangs branch October 5, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants