scan memory threshold

This commit is contained in:
Yatao Li
2022-01-23 03:35:27 +08:00
parent 8fa34da02f
commit 8e96174e1f
5 changed files with 46 additions and 0 deletions

View File

@@ -19,6 +19,8 @@
#define DEFAULT_MAX_MEM_BUFFER 2000
#define DEFAULT_THROTTLE_MEMORY_THRESHOLD 0
const char *TESS_DATAPATHS[] = {
"/usr/share/tessdata/",
"/usr/share/tesseract-ocr/tessdata/",
@@ -255,6 +257,10 @@ int scan_args_validate(scan_args_t *args, int argc, const char **argv) {
args->max_memory_buffer = DEFAULT_MAX_MEM_BUFFER;
}
if (args->throttle_memory_threshold <= 0) {
args->throttle_memory_threshold = DEFAULT_THROTTLE_MEMORY_THRESHOLD;
}
if (args->list_path != NULL) {
if (strcmp(args->list_path, "-") == 0) {
args->list_file = stdin;