mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 桌面端支持搜索图片中的文本 Fix https://github.com/siyuan-note/siyuan/issues/3470
This commit is contained in:
parent
b13eb03453
commit
5ae14c48f3
1 changed files with 2 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue