This commit is contained in:
Daniel 2024-10-30 23:17:29 +08:00
parent ca6955dc31
commit aab6131945
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 16 additions and 1 deletions

View file

@ -164,12 +164,21 @@ func OcrAsset(asset string) (ret []map[string]interface{}) {
return
}
// https://github.com/siyuan-note/siyuan/pull/11708
func GetAssetText(asset string) (ret string) {
assetsTextsLock.Lock()
ret = assetsTexts[asset]
assetsTextsLock.Unlock()
assetsTextsChanged.Store(true)
return
}
func RemoveAssetText(asset string) {
assetsTextsLock.Lock()
delete(assetsTexts, asset)
assetsTextsLock.Unlock()
assetsTextsChanged.Store(true)
}
func IsTesseractExtractable(p string) bool {
lowerName := strings.ToLower(p)
return strings.HasSuffix(lowerName, ".png") || strings.HasSuffix(lowerName, ".jpg") || strings.HasSuffix(lowerName, ".jpeg")