mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
kopt: honor TESSDATA_PREFIX environment variable
Don't override it by default, but honor it if present.
This commit is contained in:
committed by
Frans de Jonge
parent
14519bc076
commit
10e6f489d0
@@ -20,7 +20,10 @@ local util = require("util")
|
||||
|
||||
local KoptInterface = {
|
||||
ocrengine = "ocrengine",
|
||||
tessocr_data = DataStorage:getDataDir() .. "/data",
|
||||
-- If `$TESSDATA_PREFIX` is set, don't override it: let libk2pdfopt honor it
|
||||
-- (which includes checking for data in both `$TESSDATA_PREFIX/tessdata` and
|
||||
-- in `$TESSDATA_PREFIX/` on more recent versions).
|
||||
tessocr_data = not os.getenv('TESSDATA_PREFIX') and DataStorage:getDataDir().."/data" or nil,
|
||||
ocr_lang = "eng",
|
||||
ocr_type = 3, -- default 0, for more accuracy use 3
|
||||
last_context_size = nil,
|
||||
|
||||
Reference in New Issue
Block a user