When Tesseract terminates by calling the exit function,
the destructor of any local auto variable is not called.
Fix two cases by using static variables.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
libtiff is no longer needed for OpenCL, so remove that dependency.
It is still suggested for Windows to redirect warning messages
from the tesseract executable to the console.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This fixes a compiler warning:
api/baseapi.cpp:1621:17: warning:
variable 'font_name' set but not used [-Wunused-but-set-variable]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
The indentation is wrong since commit
fd0683f9e0 and results in a gcc warning:
api/baseapi.cpp: In member function 'bool tesseract::TessBaseAPI::ProcessPagesMultipageTiff(const l_uint8*, size_t, const char*, const char*, int, tesseract::TessResultRenderer*, int)':
api/baseapi.cpp:986:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (tessedit_page_number >= 0)
^~
api/baseapi.cpp:988:7: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
pix = (data) ? pixReadMemFromMultipageTiff(data, size, &offset)
^~~
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This information is not needed for normal runs, so it is sufficient
to show it on request (like versions and OpenCL information).
This also fixes a crash caused by undefined order of global constructors:
When the global variable SIMDDetect::detector is initialized before the
global variable debug_file, the first tprintf call in simddetect.cpp
crashes because of a NULL pointer in debug_file. This was only seen when
running with a shared library (libtesseract.so).
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Modify also the code to use a singleton. This simplifies the code as
no locking is needed. It also slightly improves the performance because
no check whether the architecture was tested is needed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
They were removed in commit d70f3c3663.
The old code implicitly added `-llept` by using the `AC_CHECK_LIB` macro.
Signed-off-by: Stefan Weil <sw@weilnetz.de>