mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2024-12-25 12:23:59 +00:00
Disabled info and warnings from Tesseract
This commit is contained in:
parent
331a64e387
commit
5e0f9a4898
@ -215,7 +215,13 @@ struct lib_hardsubx_ctx* _init_hardsubx(struct ccx_s_options *options)
|
||||
memset(ctx, 0, sizeof(struct lib_hardsubx_ctx));
|
||||
|
||||
ctx->tess_handle = TessBaseAPICreate();
|
||||
if(TessBaseAPIInit3(ctx->tess_handle, NULL, "eng") != 0)
|
||||
char* pars_vec = strdup("debug_file");
|
||||
char* pars_values = strdup("/dev/null");
|
||||
int res = TessBaseAPIInit4(ctx->tess_handle, NULL, "eng", OEM_TESSERACT_ONLY, NULL, 0, &pars_vec,
|
||||
&pars_values, 1, false);
|
||||
free(pars_vec);
|
||||
free(pars_values);
|
||||
if(res != 0)
|
||||
{
|
||||
fatal(EXIT_NOT_ENOUGH_MEMORY, "Not enough memory to initialize Tesseract!");
|
||||
}
|
||||
|
@ -126,12 +126,24 @@ void* init_ocr(int lang_index)
|
||||
lang_index = 1;
|
||||
}
|
||||
|
||||
if(ccx_options.ocrlang)
|
||||
ret = TessBaseAPIInit3(ctx->api, NULL, ccx_options.ocrlang);
|
||||
else if(data_location == 1)
|
||||
ret = TessBaseAPIInit3(ctx->api, NULL, language[lang_index]);
|
||||
else
|
||||
ret = TessBaseAPIInit3(ctx->api, tessdata_dir_path, language[lang_index]);
|
||||
char* lang = NULL, *tessdata_path = NULL;
|
||||
if (ccx_options.ocrlang)
|
||||
lang = ccx_options.ocrlang;
|
||||
else if (data_location == 1)
|
||||
lang = language[lang_index];
|
||||
else {
|
||||
lang = language[lang_index];
|
||||
tessdata_path = tessdata_dir_path;
|
||||
}
|
||||
|
||||
char* pars_vec = strdup("debug_file");
|
||||
char* pars_values = strdup("/dev/null");
|
||||
|
||||
ret = TessBaseAPIInit4(ctx->api, tessdata_path, lang, OEM_TESSERACT_ONLY, NULL, 0, &pars_vec,
|
||||
&pars_values, 1, false);
|
||||
|
||||
free(pars_vec);
|
||||
free(pars_values);
|
||||
|
||||
if(ret < 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user