* Fix CID 1164532 'Constant' variable guards dead code
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Fix CID 1164594 Argument cannot be negative
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Fix CID 1164597 Argument cannot be negative
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Fix CID 1366447 Argument cannot be negative
Fix also the data type for current_pos, as ftell returns a long value.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Fix CID 1270404 Arguments in wrong order
This does not change the code, but should help Coverity Scan to see
that the argument order is as intended.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* api: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccmain: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccstruct: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* classify: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* cutil: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* dict: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* textord: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* training: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* wordrec: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccutil: Replace Tesseract data types by POSIX data types
Now all Tesseract data types which are no longer needed can be removed
from ccutil/host.h.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccmain: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccstruct: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* classify: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* dict: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* lstm: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* textord: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* wordrec: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccutil: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Remove the macros which are now unused from ccutil/host.h.
Remove also the obsolete history comments.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Fix build error caused by ambiguous ClipToRange
Error message vom Appveyor CI:
C:\projects\tesseract\ccstruct\coutln.cpp(818): error C2672: 'ClipToRange': no matching overloaded function found [C:\projects\tesseract\build\libtesseract.vcxproj]
C:\projects\tesseract\ccstruct\coutln.cpp(818): error C2782: 'T ClipToRange(const T &,const T &,const T &)': template parameter 'T' is ambiguous [C:\projects\tesseract\build\libtesseract.vcxproj]
c:\projects\tesseract\ccutil\helpers.h(122): note: see declaration of 'ClipToRange'
C:\projects\tesseract\ccstruct\coutln.cpp(818): note: could be 'char'
C:\projects\tesseract\ccstruct\coutln.cpp(818): note: or 'int'
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* unittest: Replace Tesseract's MAX_INT8 by POSIX INT8_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* arch: Replace Tesseract's MAX_INT8 by POSIX INT8_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
The related code in training/util.h now uses the GOOGLE_TESSERACT macro
to enable Google specific code to disable heap checking.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
If equ_detect_ can be NULL, we must catch that case and show a warning
instead of crashing in method SetEquationDetect.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Restore support for the legacy engine
It is still needed to get text attributes which are unsupported by the
LSTM engine, and it also has better recognition rates for some texts.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* tesseractmain: Add missing 'static' attributes
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Support different help texts for normal and advanced users
The old option --help now shows a very basic help text.
The new option --help-extra shows the full help information.
It now also includes a hint that Tesseract supports lists of images.
Fix also the indentation in the PSM help and
use a more neutral text in the OEM help.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Add missing line feed in error message
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Now Tesseract adds a page break (normally form feed) by default.
It is still possible to suppress page breaks by setting an empty
page_separator.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Tesseract supports hierarchies of languages and uses them since
the new files best/*.traineddata were added.
Now `tesseract --list-langs` also shows any traineddata files in
subdirectories of the tessdata directory.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
The default resolution is used for images without an explicit resolution
or with an unreasonable resolution (smaller than 70 or larger than 2400).
Signed-off-by: Stefan Weil <sw@weilnetz.de>
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>