🎨 Re OCR popup prompt when Tesseract is not enabled https://github.com/siyuan-note/siyuan/issues/15367

This commit is contained in:
Daniel 2025-07-25 19:34:35 +08:00
parent 7787ac6e1d
commit 70741fffcc
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
15 changed files with 40 additions and 15 deletions

View file

@ -149,7 +149,12 @@ func ExistsAssetText(asset string) (ret bool) {
return
}
func OcrAsset(asset string) (ret []map[string]interface{}) {
func OcrAsset(asset string) (ret []map[string]interface{}, err error) {
if !TesseractEnabled {
err = fmt.Errorf(Langs[Lang][266])
return
}
assetsPath := GetDataAssetsAbsPath()
assetAbsPath := strings.TrimPrefix(asset, "assets")
assetAbsPath = filepath.Join(assetsPath, assetAbsPath)