Skip to content

Commit

Permalink
TesseractOCR: remove call to setlocale().
Browse files Browse the repository at this point in the history
This was a workaround for JVM crashes caused by Tesseract for years.
This is not needed anymore.
  • Loading branch information
maximumspatium committed Apr 22, 2022
1 parent e527f3c commit 6fc18ec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/main/org/audiveris/omr/text/tesseract/TesseractOCR.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ public Set<String> getLanguages ()
final Path ocrFolder = getOcrFolder();
final TreeSet<String> set = new TreeSet<>();

// we need to call this to avoid crash
// in native code on non-english systems
// https://github.com/bytedeco/javacpp-presets/issues/694
setlocale(LC_ALL(), "C");

try {
final TessBaseAPI api = new TessBaseAPI();

Expand Down
3 changes: 0 additions & 3 deletions src/main/org/audiveris/omr/text/tesseract/TesseractOrder.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,6 @@ public List<TextLine> process ()
}
}

// prevent JVM crashes on non-english systems
setlocale(LC_ALL(), "C");

if (api.Init(ocrFolder.toString(), lang, OEM_TESSERACT_ONLY) != 0) {
logger.warn("Could not initialize Tesseract with lang {}", lang);

Expand Down

0 comments on commit 6fc18ec

Please sign in to comment.