All relevant versions of Leptonica support pkg-config, so the old
configuration code can be removed.
Update also the error message for missing Leptonica.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Examples:
In training/tesstrain.sh line 64:
if (( ${LINEDATA} )); then
^-- SC2004: $/${} is unnecessary on arithmetic variables.
In training/tesstrain.sh line 56:
source `dirname $0`/language-specific.sh
^-- SC2006: Use $(..) instead of legacy `..`.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
The old settings don't work for cross compilations (wrong include path)
or require setting LIBLEPT_HEADERSDIR. They are used as fallback if
there is no pkg-config configuration.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Fix builds in subdirectories:
* Add srcdir to Manifest.txt.
* Remove srcdir from piccolo2d-core-3.0.jar and piccolo2d-extras-3.0.jar.
* Add dependency of SCROLLVIEW_CLASSES on SCROLLVIEW_LIBS.
The SCROLLVIEW_LIBS are now automatically fetched when needed.
* Add .PHONY target for fetch-jars.
* Improve rule for clean target.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
See issue #424.
The existing C API for TessBaseAPIDetectOS requires a C caller to successfully allocate struct OSResults which is actually a C++ class. Generally it won't
be possible for a regular C compiler to do this properly.
It's also assumed that most API level users of Tesseract are only interested in Tesseract's best guess as to script and orientation, not the individual values for all possible scripts.
This introduces a new API with a better name that is more closely aligned with the output of 'tesseract -psm 0'. Both tesseract -psm 0 and this API now share the same code in baseapi.cpp.
Builds without support for OpenMP failed with the old code. Fix this:
* Add OPENMP_CXXFLAGS for ccmain.
* Replace unconditional -fopenmp by OPENMP_CXXFLAGS for lstm.
* Always use _OPENMP for conditional compilation.
* Remove OPENMP as there is already _OPENMP.
* Include omp.h conditionally.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This fixes a compiler warning from clang:
ccutil/platform.h:88:13: warning:
macro name is a reserved identifier [-Wreserved-id-macro]
#define _TESS_FILE_BASENAME_ \
Signed-off-by: Stefan Weil <sw@weilnetz.de>
clang++ report:
api/baseapi.h:852:4: warning:
extra ';' after member function definition [-Wextra-semi]
[...]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Commit 03eec61a2f removed unneeded
null pointer checks after new, but missed one which now raises
a warning from coverity scan. Remove that one, too.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1366758: Memory - corruptions (USE_AFTER_FREE)
Calling "operator delete[]" frees pointer "label32"
which has already been freed.
Commit f60ff4d575 fixed several memory leaks
but also added this wrong delete operation.
label32 is assigned to char_samp->label32_, so it is freed when deleting
char_samp.
Signed-off-by: Stefan Weil <sw@weilnetz.de>