Skip to content

Commit 5fd3e22

Browse files
committed
move code around so that list-langs will work without an English traineddata file
1 parent efa50da commit 5fd3e22

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

api/tesseractmain.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,6 @@ int main(int argc, char** argv) {
441441

442442
int init_failed = api.Init(datapath, lang, enginemode, &(argv[arg_i]),
443443
argc - arg_i, &vars_vec, &vars_values, false);
444-
if (init_failed) {
445-
fprintf(stderr, "Could not initialize tesseract.\n");
446-
return EXIT_FAILURE;
447-
}
448444

449445
SetVariablesFromCLArgs(&api, argc, argv);
450446

@@ -453,6 +449,11 @@ int main(int argc, char** argv) {
453449
return EXIT_SUCCESS;
454450
}
455451

452+
if (init_failed) {
453+
fprintf(stderr, "Could not initialize tesseract.\n");
454+
return EXIT_FAILURE;
455+
}
456+
456457
if (print_parameters) {
457458
FILE* fout = stdout;
458459
fprintf(stdout, "Tesseract parameters:\n");

0 commit comments

Comments
 (0)