🎨 桌面端支持搜索图片 OCR 文本 https://github.com/siyuan-note/siyuan/issues/3470

This commit is contained in:
Liang Ding 2023-01-16 14:45:14 +08:00
parent a0143b2637
commit 9da8192567
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 196 additions and 60 deletions

View file

@ -18,7 +18,6 @@ package treenode
import (
"bytes"
"path/filepath"
"strings"
"sync"
@ -114,7 +113,7 @@ func NodeStaticContent(node *ast.Node, excludeTypes []string) string {
destNode := n.Parent.ChildByType(ast.NodeLinkDest)
if nil != destNode {
// 桌面端支持搜索图片 OCR 文本 https://github.com/siyuan-note/siyuan/issues/3470
if text := util2.Tesseract(filepath.Join(util2.DataDir, destNode.TokensStr())); "" != text {
if text := util2.GetAssetText(destNode.TokensStr()); "" != text {
buf.WriteByte(' ')
buf.WriteString(text)
}