This fixes a compiler warning:
classify/intfeaturemap.cpp:33:14: warning:
unused variable 'kMinPCLengthIncrease' [-Wunused-const-variable]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
It conflicts with a previous 'class' declaration for ETEXT_DESC:
include/tesseract/baseapi.h:594:21:
Struct 'ETEXT_DESC' was previously declared as a class
Signed-off-by: Stefan Weil <sw@weilnetz.de>
A haystack which is shorter than the needle resulted in negative value
for length_haystack which was forced to a very large unsigned value.
The resulting buffer overflow while reading the haystack would crash
text2image when it was called with a short font name.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Assertions are good for programming errors, but not for wrong user input.
The new code no longer needs File::ReadFileToStringOrDie, so remove that
method.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
The implementation for MS C did not pass the variable arguments to
tprintf.
The standard is supported since C99 / C++11, so one implementation
is sufficient.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This changes the error message for a missing font from
Could not find font named Times New Roman.Please correct --font arg.
(missing space after first sentence) to
Could not find font named Times New Roman.
Please correct --font arg.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc reported this warning:
../training/stringrenderer.cpp:
In member function ‘void tesseract::StringRenderer::SetLayoutProperties()’:
../training/stringrenderer.cpp:211:42: warning:
ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
set_features("liga, clig, dlig, hlig");
^
Signed-off-by: Stefan Weil <sw@weilnetz.de>
The previous commit added a dependency on tiffio.h, so enable the new
code only if that file is available.
The code which conditionally defines HAVE_TIFFIO_H was already there
although that macro was unused up to now.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Showing them in a window (default) is not acceptable for a console
application like Tesseract which must be able to work in batch mode.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
In Tesseract's coordinate system, width is just right - left, cf. slide #2 of
github.com/tesseract-ocr/docs/blob/master/das_tutorial2016/2ArchitectureAndDataStructures.pdf