File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -123,12 +123,15 @@ tesseract::TessBaseAPI *get_engine(TessPtr engine) {
123
123
tesseract::TessBaseAPI *api = make_analyze_api ();
124
124
writable::logicals out (params.size ());
125
125
STRING str;
126
- for (int i = 0 ; i < params.size (); i++)
126
+ for (int i = 0 ; i < params.size (); i++) {
127
127
#if TESSERACT_MAJOR_VERSION >= 5
128
128
out[i] = api->GetVariableAsString (std::string (params.at (i)).c_str (), &str);
129
129
#else
130
- out[i] = api->GetStringVariable (std::string (params.at (i)).c_str (), &str);
130
+ const char *value =
131
+ api->GetStringVariable (std::string (params.at (i)).c_str ());
132
+ out[i] = (value != nullptr );
131
133
#endif
134
+ }
132
135
api->End ();
133
136
delete api;
134
137
return out;
@@ -176,8 +179,10 @@ tesseract::TessBaseAPI *get_engine(TessPtr engine) {
176
179
if (api->GetVariableAsString (std::string (params.at (i)).c_str (), &str)) {
177
180
values.push_back (str);
178
181
#else
179
- if (api->GetStringVariable (std::string (params.at (i)).c_str (), &str)) {
180
- values.push_back (str.string ());
182
+ const char *value =
183
+ api->GetStringVariable (std::string (params.at (i)).c_str ());
184
+ if (value) {
185
+ values.push_back (value);
181
186
#endif
182
187
} else {
183
188
values.push_back (" " );
You can’t perform that action at this time.
0 commit comments