Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: OCR function cannot be used normally on Linux https://github.com/siyuan-note/siyuan/issues/12960

Daniel92504ab28099
diff --git a/kernel/util/ocr.go b/kernel/util/ocr.go
index ab045c1368..8dadbf4024 100644
--- a/kernel/util/ocr.go
+++ b/kernel/util/ocr.go
@@ -228,9 +228,10 @@ func Tesseract(imgAbsPath string) (ret []map[string]interface{}) {
}
tsv := string(output)
- logging.LogInfof("tesseract [path=%s] success [%s]", imgAbsPath, tsv)
+ //logging.LogInfof("tesseract [path=%s] success [%s]", imgAbsPath, tsv)
// 按行分割 TSV 数据
+ tsv = strings.ReplaceAll(tsv, "\r", "")
lines := strings.Split(tsv, "\n")
// 解析 TSV 数据 跳过标题行,从第二行开始处理