mozhi/utils/imgtxt.go

14 lines
231 B
Go
Raw Normal View History

2023-07-03 17:46:58 +05:30
package utils
import (
"github.com/otiai10/gosseract/v2"
)
func ImgTxt(file string) (string, error) {
2023-07-03 17:46:58 +05:30
client := gosseract.NewClient()
defer client.Close()
client.SetImage(file)
text, err := client.Text()
return text, err
2023-07-03 17:46:58 +05:30
}