Commit Graph

3653 Commits

Author SHA1 Message Date
Amit Dovev
6b08184a2c Update Makefile.am 2015-12-18 16:12:32 +02:00
zdenop
83cfd843fc Merge pull request #167 from stweil/master
Get tessdata prefix from executable path (only for Windows)
2015-12-13 18:36:50 +01:00
zdenop
e3f56ccc57 Merge pull request #173 from amitdo/renderers-default-to-text
If there is no explicit renderer(s), default to TessTextRenderer
2015-12-13 17:18:58 +01:00
amitdo
a20156fc67 Add missing ')'_to make the code compile 2015-12-11 19:42:16 +02:00
amitdo
c2f5e9b849 If there is no explicit renderer(s), default to TessTextRenderer
Revert fd429c32, 43834da7, 05de195e.

See #49, #59.

The code in this commit solves the issue in a more elegant way, IMHO.

Now you can use:
  * `tesseract eurotext.tif eurotext txt pdf`
  * `tesseract eurotext.tif eurotext txt hocr`
  * `tesseract eurotext.tif eurotext txt hocr pdf`

NOTE:
  With `tesseract eurotext.tif eurotext`
  or `tesseract eurotext.tif eurotext txt`
  the psm will be set to '3', but...
  With `tesseract eurotext.tif eurotext txt pdf`
  or `tesseract eurotext.tif eurotext txt hocr`
  the psm will be set to '1'.
2015-12-11 19:06:49 +02:00
Stefan Weil
450efa68cd Get tessdata prefix from executable path (only for Windows)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-12-11 10:06:21 +01:00
zdenop
d4e0c6459a Merge pull request #164 from stweil/master
Small fixes for documentation
2015-12-07 15:37:04 +01:00
Stefan Weil
9295875099 Fix typo in documentation and add missing blank
The typo was reported by Amit Dovev <amitdev2222@gmail.com>.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-12-07 14:37:25 +01:00
Stefan Weil
2679226aac Fix grammar in license file
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-12-07 14:34:24 +01:00
zdenop
20afd34032 Merge pull request #163 from stweil/master
Small improvements for documentation
2015-12-04 19:25:27 +01:00
Stefan Weil
7847860a1e Small improvements for documentation
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-12-04 10:50:16 +01:00
zdenop
c2a1848313 Merge pull request #159 from egorpugin/master
Download icu on windows to build set_unicharset_properties target.
2015-11-30 17:17:51 +01:00
zdenop
14fd4933bc Merge pull request #158 from stweil/master
tesseractmain: Prettify help message
2015-11-30 17:17:05 +01:00
Egor Pugin
5dee50aa03 Show all warnings. 2015-11-30 11:52:21 +03:00
Egor Pugin
c16c7831a2 Merge branch 'master' of github.com:tesseract-ocr/tesseract 2015-11-30 11:43:18 +03:00
Egor Pugin
f15cd961c6 Download icu on windows to build set_unicharset_properties target. 2015-11-30 11:43:01 +03:00
Stefan Weil
71c9e028f7 tesseractmain: Prettify help message
Commit 99110df757 improved the help text
in several aspects, but also introduced new inconsistencies which this
patch tries to fix.

* Align columns (this needed replacing tabs by spaces).
* Start explaining text with uppercase.
* Replace "the stdout" by "stdout.
* Small changes in help text for page segmentation modes.
* Split options in OCR options and single options
  (partially revert commit 99110df757).

In addition, whitespace characters at end of lines were removed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-29 10:26:40 +01:00
zdenop
d025616af5 Merge pull request #148 from nickjwhite/tesstrainbetterargs
Use shell quoting rather than pluses to separate font arguments in tesstrain.sh
2015-11-27 21:56:40 +01:00
zdenop
359593217b Merge pull request #149 from nickjwhite/updategrc
Add defaults for grc training to language-specific.sh
2015-11-27 21:55:46 +01:00
zdenop
f396a2153f Merge pull request #157 from stweil/work
Fix free of buffer which was not allocated
2015-11-27 21:54:36 +01:00
zdenop
7cc7c6f9c2 Merge pull request #156 from stweil/master
pdfrenderer: Fix uninitialized local variables
2015-11-27 21:53:55 +01:00
zdenop
1d83b1dd25 Merge pull request #127 from amitdo/split-main
tesseractmain.cpp: Split huge main() to sub functions.
2015-11-27 21:41:29 +01:00
Stefan Weil
6f1142080a Fix free of buffer which was not allocated
Coverity bug report: CID 1270420 "Free of address-of expression"

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-27 07:02:22 +01:00
amitdo
99110df757 tesseractmain.cpp: Split huge main() to sub functions
Add these functions to api/tesseractmain.cpp:
PrintVersionInfo()
PrintUsage()
PrintHelpForPSM()
PrintHelpMessage()
SetVariablesFromCLArgs()
PrintLangsList()
FixPageSegMode()
ParseArgs()
PreloadRenderers()
2015-11-26 11:36:16 +02:00
Stefan Weil
5ce88d7f49 pdfrenderer: Fix uninitialized local variables
Coverity bug reports:

CID 1270405: Uninitialized scalar variable
CID 1270408: Uninitialized scalar variable
CID 1270409: Uninitialized scalar variable
CID 1270410: Uninitialized scalar variable

Those variables are set conditionally in the while loop
and must keep their values in following iterations, so
they must be declared outside of the loop.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-25 22:24:06 +01:00
zdenop
198ee0a820 Merge pull request #155 from stweil/master
Fix duplicate fclose
2015-11-25 09:28:53 +01:00
Stefan Weil
9f87c36e23 Fix duplicate fclose
Coverity bug report: CID 1270401 (#1 of 1): Use after free

As the comment (which was also fixed) says, ReadNextBox() already
calls fclose(box_file), so don't call it a 2nd time.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-25 07:32:55 +01:00
zdenop
62ae99cfbe Merge pull request #154 from stweil/master
tesseractmain: Fix unterminated string
2015-11-24 21:17:39 +01:00
Stefan Weil
03f37c0cdc tesseractmain: Fix unterminated string
Coverity bug report: CID 1270421 "Buffer not null terminated".

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-24 17:17:17 +01:00
zdenop
9c13a157d3 Merge pull request #145 from stweil/clean
ccmain: Remove unused private class member
2015-11-14 12:01:51 +01:00
zdenop
e2cd620d69 Merge pull request #144 from stweil/master
Remove checks for this == NULL
2015-11-10 19:16:29 +01:00
Stefan Weil
39de21c91b ccmain: Remove unused private class member
This fixes a warning from clang.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-10 19:08:47 +01:00
Stefan Weil
4fdf272ffa Remove checks for this == NULL
This fixes warnings from clang.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-07 13:09:53 +01:00
zdenop
20e3b21949 Merge pull request #141 from stweil/master
Remove register attribute for local variables
2015-11-07 12:59:56 +01:00
zdenop
b6977963bb Merge pull request #143 from stweil/travis
Fix Travis build error (error when getting cmake)
2015-11-07 10:13:52 +01:00
Stefan Weil
a940180e9a Fix Travis build error (error when getting cmake)
This command fails currently:

wget http://www.cmake.org/files/v3.3/cmake-3.3.1-Linux-x86_64.sh

Obviously cmake.org now redirects to https connections, so we have to
fix the URL. Then there still remains a certificate problem. Adding
--no-check-certificate is a workaround which should be removed later.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-07 10:13:33 +01:00
Stefan Weil
83541d8ea0 Remove register attribute for local variables
This fixes clang compiler warnings like this one:

wordrec/gradechop.cpp:52:3: warning:
 'register' storage class specifier is deprecated [-Wdeprecated-register]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-06 06:45:19 +01:00
zdenop
479fe9c370 Merge pull request #137 from stweil/master
Fix compiler warnings for copy constructors
2015-11-05 09:42:53 +01:00
Stefan Weil
4a92ff5862 Fix compiler warnings for copy constructors
gcc reports these warnings with -Wextra:

ccstruct/pageres.h:330:3: warning:
 base class 'class ELIST_LINK' should be explicitly initialized
 in the copy constructor [-Wextra]
ccstruct/ratngs.cpp:115:1: warning:
 base class 'class ELIST_LINK' should be explicitly initialized
 in the copy constructor [-Wextra]
ccstruct/ratngs.h:291:3: warning:
 base class 'class ELIST_LINK' should be explicitly initialized
 in the copy constructor [-Wextra]
ccutil/genericvector.h:435:3: warning:
 base class 'class GenericVector<WERD_RES*>' should be explicitly initialized
 in the copy constructor [-Wextra]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-05 09:19:37 +01:00
zdenop
40637384d3 Merge pull request #136 from stweil/master
Fix some compiler warnings
2015-11-05 08:56:02 +01:00
Stefan Weil
70fd7cdf0a ccstruct: Fix compiler warning (disable buggy code)
gcc reports a potential bad array access:

ccstruct/mod128.cpp:98:20: warning:
 array subscript has type 'char' [-Wchar-subscripts]

dir is of type 'char'. Most compilers use signed char by default.
Then the value of dir is in the range -128 ... 127 and cannot be
used to access an array with 256 elements.

Don't fix that but disable the buggy code.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-05 06:39:35 +01:00
Stefan Weil
997c4a6078 api: Fix printing of a size_t value
size_t is not always the same as long, especially not for 64 bit Windows:

api/pdfrenderer.cpp:549:31: warning:
 format '%ld' expects argument of type 'long int',
 but argument 4 has type 'size_t {aka long long unsigned int}' [-Wformat=]

size_t normally requires a format string "%zu", but this is unsupported
by Visual Studio, so use a type cast.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-05 06:39:35 +01:00
Stefan Weil
511e7f7908 Fix case of include file name
Windows.h works on Windows, but not for cross builds on Linux hosts
with case sensitive file systems which only provide windows.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-05 06:38:01 +01:00
Stefan Weil
3272b62201 Don't use NULL for integer arguments
This fixes compiler warnings:

api/baseapi.cpp:1422:49: warning:
 passing NULL to non-pointer argument 6 of
 'int MultiByteToWideChar(UINT, DWORD, LPCCH, int, LPWSTR, int)'
 [-Wconversion-null]
api/baseapi.cpp:1427:54:
 warning: passing NULL to non-pointer argument 6 of
 'int WideCharToMultiByte(UINT, DWORD, LPCWCH, int, LPSTR, int, LPCCH, LPBOOL)'
 [-Wconversion-null]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-05 06:38:01 +01:00
Stefan Weil
edf765b952 Remove unneeded const qualifiers
This fixes compiler warnings like this one:

api/baseapi.h:739:32: warning:
 type qualifiers ignored on function return type [-Wignored-qualifiers]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-05 06:36:42 +01:00
zdenop
eb34cb1c94 Merge pull request #133 from stweil/master
Fix some typos found by codespell
2015-11-04 22:42:30 +01:00
Zdenko Podobný
34f34eadb8 autotools: fail if g++ or clang++ compiler is not found; Fixes #130 2015-11-04 22:39:24 +01:00
Stefan Weil
053403ecdb viewer: Fix typos in comments
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-04 21:58:42 +01:00
Stefan Weil
29f36d9264 training: Fix typos in comments and strings
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-04 21:58:42 +01:00
Stefan Weil
64f9190575 textord: Fix typos in comments and strings
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-04 21:58:42 +01:00