@@ -173,6 +173,11 @@ void PrintLangsList(tesseract::TessBaseAPI* api) {
173
173
api->End ();
174
174
}
175
175
176
+ void PrintBanner () {
177
+ tprintf (" Tesseract Open Source OCR Engine v%s with Leptonica\n " ,
178
+ tesseract::TessBaseAPI::Version ());
179
+ }
180
+
176
181
/* *
177
182
* We have 2 possible sources of pagesegmode: a config file and
178
183
* the command line. For backwards compatibility reasons, the
@@ -275,12 +280,6 @@ void ParseArgs(const int argc, char** argv,
275
280
PrintHelpMessage (argv[0 ]);
276
281
exit (1 );
277
282
}
278
-
279
- if (*outputbase != NULL && strcmp (*outputbase, " -" ) &&
280
- strcmp (*outputbase, " stdout" )) {
281
- tprintf (" Tesseract Open Source OCR Engine v%s with Leptonica\n " ,
282
- tesseract::TessBaseAPI::Version ());
283
- }
284
283
}
285
284
286
285
void PreloadRenderers (tesseract::TessBaseAPI* api,
@@ -359,6 +358,12 @@ int main(int argc, char **argv) {
359
358
&list_langs, &print_parameters,
360
359
&vars_vec, &vars_values, &arg_i, &pagesegmode);
361
360
361
+ bool banner = false ;
362
+ if (outputbase != NULL && strcmp (outputbase, " -" ) &&
363
+ strcmp (outputbase, " stdout" )) {
364
+ banner = true ;
365
+ }
366
+
362
367
PERF_COUNT_START (" Tesseract:main" )
363
368
tesseract::TessBaseAPI api;
364
369
@@ -439,6 +444,7 @@ int main(int argc, char **argv) {
439
444
}
440
445
441
446
if (!renderers.empty ()) {
447
+ if (banner) PrintBanner ();
442
448
bool succeed = api.ProcessPages (image, NULL , 0 , renderers[0 ]);
443
449
if (!succeed) {
444
450
fprintf (stderr, " Error during processing.\n " );
0 commit comments