Commit Graph

1661 Commits

Author SHA1 Message Date
Zdenko Podobný
90db5a17f0 Issue #529: cleanup 2017-05-19 20:24:17 +02:00
Stefan Weil
fd1098db3d Fix crash if output file could not be opened
This error case results in fout_ == NULL.
Closing a NULLfile is not allowed.
2017-05-19 20:21:16 +02:00
Zdenko Podobný
f961efc997 Optimize code by replacing init_to_size with resize_no_init
There is no need to initialize memory with a fixed value which is
overwritten in the next step.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 20:19:20 +02:00
Zdenko Podobný
e5656102a8 genericvector: Fix and optimize function LoadDataFromFile
It's not necessary to initialize the vector with 0,
because the initial values are read from file.

Fix also an assertion when trying to read an empty file.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 20:12:20 +02:00
Stefan Weil
0c5ee4ba7b baseapi: Simplify code
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 20:08:42 +02:00
Stefan Weil
5080223fe6 Clean method UNICHARSET::add_script
It increased the script_table too early, so the last element was never
used.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 20:07:25 +02:00
Zdenko Podobný
201ec04caa Fix order of destructor calls for DawgCache and TessBaseAPI
TessBaseAPI must release its cache use before DawgCache is destroyed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 20:07:04 +02:00
Stefan Weil
828bb63891 main: Fix two memory leaks
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>
2017-05-19 20:04:59 +02:00
Stefan Weil
658a198535 ccutil: Remove unneeded include statement
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 20:04:30 +02:00
Raf Schietekat
33b2ae884d Fewer g++ -Wmaybe-uninitialized warnings 2017-05-19 20:01:56 +02:00
Stefan Weil
830894b2f6 Improve index range check
A wrong array index must raise an assertion instead of printing an
error message and continuing program execution.

Remove also some float operations which are not needed because the
blob_box coordinates are of type int16_t.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 19:58:08 +02:00
Stefan Weil
b9af384784 Fix wrong format string
The local variable intval is of type int.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 19:57:20 +02:00
Stefan Weil
12e7426fa8 Remove undefined macro MAC_OR_DOS
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 19:51:15 +02:00
Stefan Weil
aabb80fbf6 cutil: Remove unused freelist.c and freelist.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 19:50:54 +02:00
Stefan Weil
731f8cfcd6 cutil: Remove unused code using memfree
The case (destructor == NULL) never occurs in the current code.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 19:50:04 +02:00
Zdenko Podobný
57629240f6 Replace memalloc / memfree by C++ new / delete
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 19:48:10 +02:00
Stefan Weil
8ff183b300 blobs: Remove unused macro
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 19:46:36 +02:00
Stefan Weil
f44d57f454 Remove unused global function memrealloc
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 19:46:26 +02:00
Stefan Weil
a24ae07480 Remove unused include statements for freelist.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-19 19:46:13 +02:00
zdenop
0002206e54 Merge pull request #908 from stweil/3.05
3.05: Remove most libtiff dependencies
2017-05-12 12:48:29 +02:00
Stefan Weil
3867584401 Remove most libtiff dependencies
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>
2017-05-12 10:29:53 +02:00
Egor Pugin
7439cf8e80 Use NDEBUG macro instead of DEBUG. 2017-05-08 13:05:08 +03:00
Egor Pugin
32ccbe1843 Set proper dependency for text2image. 2017-05-07 21:15:16 +03:00
Egor Pugin
07194ab235 Update CMakeLists.txt 2017-05-07 20:13:04 +03:00
Egor Pugin
5acc64e645 Update appveyor.yml 2017-05-07 01:03:47 +03:00
zdenop
d7e5d4338e Merge pull request #891 from stweil/3.05
3.05: Cmake install
2017-05-06 19:36:40 +02:00
Aleksey Nikolaev
3e0b722b3a Cmake install
[sw: Removed CMakeList.txt from commit]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-06 12:45:11 +02:00
Zdenko Podobný
d09627550c fix typo 2017-05-05 23:47:44 +02:00
Zdenko Podobný
de6786f998 Fix Travis and Appveyor status for 3.05 branch. Fixes #720 and #721 2017-05-05 23:44:08 +02:00
Egor Pugin
c97e5bc8be Merge pull request #886 from stweil/3.05
3.05: Fix typo in comment
2017-05-05 23:51:40 +03:00
Stefan Weil
4319f6cbaa Fix typo in comment
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-05 22:42:23 +02:00
Zdenko Podobný
10f96d1e80 backport doc and testing changes from master (4.0) 2017-05-05 20:40:35 +02:00
Zdenko Podobný
5fe49627bf backport build changes from master (4.0) 2017-05-05 20:40:12 +02:00
Zdenko Podobný
159e34a81d show only error messages from Leptonica 2017-05-05 20:17:38 +02:00
Zdenko Podobný
5c2e557435 backport OpenCL changes from master (4.0) 2017-05-05 20:14:45 +02:00
Zdenko Podobný
90b6f17838 backport pdfrenderer changes from master (4.0) 2017-05-05 20:10:03 +02:00
Stefan Weil
71712d1073 ccstruct: Remove unneeded NULL checks
It's also not necessary to nullify class variables in the destructor.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-05 19:09:25 +02:00
Stefan Weil
1efacc4e24 api: Remove unneeded NULL checks
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-05 19:09:03 +02:00
Stefan Weil
5491a507f4 doc: Remove unsupported font name
Fix this warning from doxygen:

    warning: doxygen no longer ships with the FreeSans font.
    You may want to clear or change DOT_FONTNAME.
    Otherwise you run the risk that the wrong font is being used for dot generated graphs.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-05 19:06:56 +02:00
Bryce Glover
c19d5cbc61 autogen.sh: Small Typo Fix
Implement and contribute one small typographical fix, thereby improving the readability of the script's check
for the existence of the `m4` top-level directory.
2017-05-05 19:05:03 +02:00
Stefan Weil
b174612f26 Fix typo
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-05-05 19:04:52 +02:00
Jim Regan
cb7f2c7f88 typo in comment 2017-05-05 19:04:39 +02:00
Amit D
a4225fd3ce Update README.md 2017-05-05 19:03:08 +02:00
Jakub Wilk
de6cf8fbdf Fix typos 2017-05-05 18:57:26 +02:00
Egor Pugin
394eee69ce Fix possible warning when WIN32_LEAN_AND_MEAN is already defined. 2017-05-05 18:46:35 +02:00
Wikinaut
40150eaa9f Improve textonly_pdf parameter description 2017-05-05 18:46:03 +02:00
Zdenko Podobný
d6f6561034 Fix C-API 2017-05-05 18:45:36 +02:00
James R. Barlow
aebd553a1e Fix PDF syntax error: "XObject" instead of "/XObject" when textonly_pdf=false 2017-05-05 18:45:23 +02:00
Zdenko Podobný
971336cef0 Implement invisible text only for PDF 2017-05-05 18:41:25 +02:00
zdenop
b45a60cc80 Merge pull request #869 from stweil/3.05
3.05: Backports from master branch
2017-05-04 09:22:49 +02:00