Skip to content

Commit

Permalink
🐛 加入诊断日志 macOS 端 Tesseract OCR 安装后不识别 #7107
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jan 17, 2023
1 parent 16c4893 commit 1db58b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/util/tesseract.go
Expand Up @@ -137,18 +137,20 @@ 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()
if nil != err {
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) {
Expand Down

0 comments on commit 1db58b5

Please sign in to comment.