Skip to content

In-memory version traineddata doesn't work for multiple traineddata #4017

@arvintnn

Description

@arvintnn

Basic Information

Windows 10, tessseract v4,
If I passed single traineddata (const char ), it works, but fails for multiple traineddata, by the way multiple traineddata works if I passed the path to traineddata.
I append the two trained data together and pass it to the Init, the LoadMemBuffer( bool readsuccesfully_= mgr.LoadMemBuffer(language, data, data_size);) reads the first one and parse it, the entries_[TESSDATA_VERSION] populated correctly, then when it proceeds to the second traineddata, it treats it as path to traineddata, and tries to locate the traineddata on the disk, and failes to initialize correctly
// In-memory version reads the traineddata file directly from the given
// data[data_size] array. Also implements the version with a datapath in data,
// flagged by data_size = 0.
int TessBaseAPI::Init(const char
data, int data_size, const char* language,
OcrEngineMode oem, char** configs, int configs_size,
const GenericVector* vars_vec,
const GenericVector* vars_values,
bool set_only_non_debug_params, FileReader reader) {

Operating System

Windows 10

Other Operating System

Windows 10, tesseract Windows SDK Version 10.0.17763.0

uname -a

No response

Compiler

MSVC 2017, visual studio version 15.9.25

Virtualization / Containers

No response

CPU

Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz 3.70

Current Behavior

No response

Expected Behavior

No response

Suggested Fix

No response

Other Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions