mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-24 11:09:06 +08:00
Merge pull request #255 from amitdo/no-banner
Don't display tesseract's banner when quiet mode is active
This commit is contained in:
commit
976433820c
@ -173,6 +173,11 @@ void PrintLangsList(tesseract::TessBaseAPI* api) {
|
||||
api->End();
|
||||
}
|
||||
|
||||
void PrintBanner() {
|
||||
tprintf("Tesseract Open Source OCR Engine v%s with Leptonica\n",
|
||||
tesseract::TessBaseAPI::Version());
|
||||
}
|
||||
|
||||
/**
|
||||
* We have 2 possible sources of pagesegmode: a config file and
|
||||
* the command line. For backwards compatibility reasons, the
|
||||
@ -275,12 +280,6 @@ void ParseArgs(const int argc, char** argv,
|
||||
PrintHelpMessage(argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (*outputbase != NULL && strcmp(*outputbase, "-") &&
|
||||
strcmp(*outputbase, "stdout")) {
|
||||
tprintf("Tesseract Open Source OCR Engine v%s with Leptonica\n",
|
||||
tesseract::TessBaseAPI::Version());
|
||||
}
|
||||
}
|
||||
|
||||
void PreloadRenderers(tesseract::TessBaseAPI* api,
|
||||
@ -359,6 +358,12 @@ int main(int argc, char **argv) {
|
||||
&list_langs, &print_parameters,
|
||||
&vars_vec, &vars_values, &arg_i, &pagesegmode);
|
||||
|
||||
bool banner = false;
|
||||
if (outputbase != NULL && strcmp(outputbase, "-") &&
|
||||
strcmp(outputbase, "stdout")) {
|
||||
banner = true;
|
||||
}
|
||||
|
||||
PERF_COUNT_START("Tesseract:main")
|
||||
tesseract::TessBaseAPI api;
|
||||
|
||||
@ -439,6 +444,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (!renderers.empty()) {
|
||||
if (banner) PrintBanner();
|
||||
bool succeed = api.ProcessPages(image, NULL, 0, renderers[0]);
|
||||
if (!succeed) {
|
||||
fprintf(stderr, "Error during processing.\n");
|
||||
|
Loading…
Reference in New Issue
Block a user