mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-11 01:34:20 +01:00
🎨 导入 .sy.zip 时增量建立索引 https://github.com/siyuan-note/siyuan/issues/7123
This commit is contained in:
parent
7401ae845a
commit
772984fe1b
4 changed files with 51 additions and 6 deletions
|
|
@ -59,11 +59,20 @@ func GetAssetText(asset string) string {
|
|||
return ret
|
||||
}
|
||||
|
||||
func IsTesseractExtractable(p string) bool {
|
||||
lowerName := strings.ToLower(p)
|
||||
return strings.HasSuffix(lowerName, ".png") || strings.HasSuffix(lowerName, ".jpg") || strings.HasSuffix(lowerName, ".jpeg")
|
||||
}
|
||||
|
||||
func Tesseract(imgAbsPath string) string {
|
||||
if ContainerStd != Container || !TesseractEnabled {
|
||||
return ""
|
||||
}
|
||||
|
||||
if !IsTesseractExtractable(imgAbsPath) {
|
||||
return ""
|
||||
}
|
||||
|
||||
info, err := os.Stat(imgAbsPath)
|
||||
if nil != err {
|
||||
return ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue