mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 20:38:49 +01:00
🎨 Supports via environment var SIYUAN_TESSERACT_ENABLED=false to close OCR Fix https://github.com/siyuan-note/siyuan/issues/9619
This commit is contained in:
parent
1ca374b1bf
commit
efec2c749e
1 changed files with 11 additions and 0 deletions
|
|
@ -149,6 +149,17 @@ func InitTesseract() {
|
|||
}
|
||||
}
|
||||
|
||||
// Supports via environment var `SIYUAN_TESSERACT_ENABLED=false` to close OCR https://github.com/siyuan-note/siyuan/issues/9619
|
||||
if enabled := os.Getenv("SIYUAN_TESSERACT_ENABLED"); "" != enabled {
|
||||
if enabledBool, parseErr := strconv.ParseBool(enabled); nil == parseErr {
|
||||
TesseractEnabled = enabledBool
|
||||
if !enabledBool {
|
||||
logging.LogInfof("tesseract-ocr disabled by env")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TesseractLangs = filterTesseractLangs(langs)
|
||||
logging.LogInfof("tesseract-ocr enabled [ver=%s, maxSize=%s, langs=%s]", ver, humanize.Bytes(TesseractMaxSize), strings.Join(TesseractLangs, "+"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue