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

This commit is contained in:
Liang Ding 2023-01-15 23:54:13 +08:00
parent b13eb03453
commit 5ae14c48f3
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -21,7 +21,6 @@ import (
"context"
"os"
"os/exec"
"regexp"
"strings"
"time"
@ -97,8 +96,8 @@ func Tesseract(imgAbsPath string) string {
}
ret := string(output)
reg := regexp.MustCompile("\\s+")
ret = reg.ReplaceAllString(ret, "")
ret = strings.ReplaceAll(ret, "\r", "")
ret = strings.ReplaceAll(ret, "\n", "")
logging.LogInfof("tesseract [path=%s, size=%d]: %s", imgAbsPath, info.Size(), ret)
ocrResultCache.Set(imgAbsPath, ret, info.Size())
return ret