🎨 Supports via environment var SIYUAN_TESSERACT_ENABLED=false to close OCR Fix https://github.com/siyuan-note/siyuan/issues/9619

This commit is contained in:
Daniel 2023-11-10 11:23:27 +08:00
parent efec2c749e
commit 524776c005
No known key found for this signature in database
GPG Key ID: 86211BA83DF03017
2 changed files with 6 additions and 3 deletions

View File

@ -37,8 +37,9 @@ func autoOCRAssets() {
util.AssetsTextsLock.Lock()
util.AssetsTexts[p] = text
util.AssetsTextsLock.Unlock()
util.AssetsTextsChanged = true
if "" != text {
util.AssetsTextsChanged = true
}
if 4 <= i { // 一次任务中最多处理 4 张图片,防止卡顿
break
}

View File

@ -69,7 +69,9 @@ func GetAssetText(asset string, force bool) string {
AssetsTextsLock.Lock()
AssetsTexts[asset] = ret
AssetsTextsLock.Unlock()
AssetsTextsChanged = true
if "" != ret {
AssetsTextsChanged = true
}
return ret
}