mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-11 23:19:04 +08:00
fix issue 962
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@866 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
b5e16669e1
commit
5b9cfaf30d
@ -29,6 +29,9 @@ lang = "eng"
|
||||
filename = "../phototest.tif"
|
||||
libpath = "/usr/local/lib64/"
|
||||
libpath_w = "../vs2008/DLL_Release/"
|
||||
TESSDATA_PREFIX = os.environ.get('TESSDATA_PREFIX')
|
||||
if not TESSDATA_PREFIX:
|
||||
TESSDATA_PREFIX = "../"
|
||||
|
||||
if sys.platform == "win32":
|
||||
libname = libpath_w + "libtesseract302.dll"
|
||||
@ -50,7 +53,7 @@ except:
|
||||
exit(1)
|
||||
|
||||
tesseract.TessVersion.restype = ctypes.c_char_p
|
||||
tesseract_version = tesseract.TessVersion()
|
||||
tesseract_version = tesseract.TessVersion()[:4]
|
||||
|
||||
# We need to check library version because libtesseract.so.3 is symlink
|
||||
# and can point to other version than 3.02
|
||||
@ -60,7 +63,7 @@ if float(tesseract_version) < 3.02:
|
||||
exit(2)
|
||||
|
||||
api = tesseract.TessBaseAPICreate()
|
||||
rc = tesseract.TessBaseAPIInit3(api, "", lang);
|
||||
rc = tesseract.TessBaseAPIInit3(api, TESSDATA_PREFIX, lang);
|
||||
if (rc):
|
||||
tesseract.TessBaseAPIDelete(api)
|
||||
print("Could not initialize tesseract.\n")
|
||||
|
Loading…
Reference in New Issue
Block a user