mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 20:59:36 +08:00
fix "cannot pass non-trivial object of type 'std::string'"
This commit is contained in:
parent
8a26329623
commit
005bfe4950
@ -66,18 +66,18 @@ static int Main(int argc, char **argv) {
|
||||
// Load input files
|
||||
for (int arg = 1; arg < argc; ++arg) {
|
||||
std::filesystem::path filePath = argv[arg];
|
||||
std::string file_data = tesseract::ReadFile(filePath.u8string());
|
||||
std::string file_data = tesseract::ReadFile(argv[arg]);
|
||||
if (file_data.empty()) {
|
||||
continue;
|
||||
}
|
||||
std::vector<std::string> texts;
|
||||
if (filePath.extension() == ".box") {
|
||||
tprintf("Extracting unicharset from box file %s\n", filePath.u8string());
|
||||
tprintf("Extracting unicharset from box file %s\n", argv[arg]);
|
||||
bool res = ReadMemBoxes(-1, /*skip_blanks*/ true, &file_data[0],
|
||||
/*continue_on_failure*/ false, /*boxes*/ nullptr, &texts,
|
||||
/*box_texts*/ nullptr, /*pages*/ nullptr);
|
||||
if (!res) {
|
||||
tprintf("Can not read box data from '%s'\n", filePath.u8string());
|
||||
tprintf("Can not read box data from '%s'\n", argv[arg]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user