🐛 加入诊断日志 macOS 端 Tesseract OCR 安装后不识别 https://github.com/siyuan-note/siyuan/issues/7107

This commit is contained in:
Liang Ding 2023-01-17 23:29:44 +08:00
parent 82145475a8
commit 16c489356f
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -144,6 +144,11 @@ func getTesseractVer() (ret string) {
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))
if nil == err && strings.HasPrefix(string(data), "tesseract ") {
parts := bytes.Split(data, []byte("\n"))
if 0 < len(parts) {