A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/tesseract-ocr/tesseract/issues/4416 below:

GetAvailableLanguagesAsVector() can list unrelated files due to invalid extension handling · Issue #4416 · tesseract-ocr/tesseract · GitHub

Current Behavior

The file extension handling code in

auto extPos = path.rfind(".traineddata"); if (extPos != std::string::npos) { langs->push_back(path.substr(0, extPos)); }

only checks that the file name has a ".taineddata" substring rather than strictly ends with it. As the result, the GetAvailableLanguagesAsVector() method can treat unrelated files (in my case,

*.traineddata.sha256

) as languages.

Expected Behavior

No response

Suggested Fix

Use std::filesystem::path::extension().

tesseract -v

5.5.0

Operating System

No response

Other Operating System

No response

uname -a

No response

Compiler

No response

CPU

No response

Virtualization / Containers

No response

Other Information

No response


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4