diff --git a/kernel/model/ocr.go b/kernel/model/ocr.go index 8acb61f8c..067a32232 100644 --- a/kernel/model/ocr.go +++ b/kernel/model/ocr.go @@ -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 } diff --git a/kernel/util/tesseract.go b/kernel/util/tesseract.go index 17d50ac25..589fd9b3c 100644 --- a/kernel/util/tesseract.go +++ b/kernel/util/tesseract.go @@ -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 }