diff --git a/api/tesseractmain.cpp b/api/tesseractmain.cpp index bca122523a..647e1263b4 100644 --- a/api/tesseractmain.cpp +++ b/api/tesseractmain.cpp @@ -441,10 +441,6 @@ int main(int argc, char** argv) { int init_failed = api.Init(datapath, lang, enginemode, &(argv[arg_i]), argc - arg_i, &vars_vec, &vars_values, false); - if (init_failed) { - fprintf(stderr, "Could not initialize tesseract.\n"); - return EXIT_FAILURE; - } SetVariablesFromCLArgs(&api, argc, argv); @@ -453,6 +449,11 @@ int main(int argc, char** argv) { return EXIT_SUCCESS; } + if (init_failed) { + fprintf(stderr, "Could not initialize tesseract.\n"); + return EXIT_FAILURE; + } + if (print_parameters) { FILE* fout = stdout; fprintf(stdout, "Tesseract parameters:\n");