🎨 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

@ -153,7 +153,14 @@ func ocr(c *gin.Context) {
path := arg["path"].(string)
ocrJSON := util.OcrAsset(path)
ocrJSON, err := util.OcrAsset(path)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
ret.Data = map[string]interface{}{"closeTimeout": 7000}
return
}
ret.Data = map[string]interface{}{
"text": util.GetOcrJsonText(ocrJSON),
"ocrJSON": ocrJSON,