mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🐛 加入诊断日志 macOS 端 Tesseract OCR 安装后不识别 https://github.com/siyuan-note/siyuan/issues/7107
This commit is contained in:
parent
16c489356f
commit
1db58b5bd2
1 changed files with 3 additions and 1 deletions
|
|
@ -137,10 +137,12 @@ func initTesseract() {
|
|||
}
|
||||
|
||||
func getTesseractVer() (ret string) {
|
||||
logging.LogInfof("checking tesseract-ocr [Container=%s]", Container)
|
||||
if ContainerStd != Container {
|
||||
return
|
||||
}
|
||||
|
||||
logging.LogInfof("exec [tesseract --version]")
|
||||
cmd := exec.Command("tesseract", "--version")
|
||||
gulu.CmdAttr(cmd)
|
||||
data, err := cmd.CombinedOutput()
|
||||
|
|
@ -148,7 +150,7 @@ func getTesseractVer() (ret string) {
|
|||
logging.LogErrorf("get tesseract version failed: %s", err)
|
||||
return
|
||||
}
|
||||
logging.LogInfof("tesseract version: %s", string(data))
|
||||
logging.LogInfof("tesseract version output [%s]", string(data))
|
||||
if nil == err && strings.HasPrefix(string(data), "tesseract ") {
|
||||
parts := bytes.Split(data, []byte("\n"))
|
||||
if 0 < len(parts) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue