2023-07-03 12:16:58 +00:00
|
|
|
package utils
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/otiai10/gosseract/v2"
|
|
|
|
)
|
|
|
|
|
2023-08-15 09:25:49 +00:00
|
|
|
func ImgTxt(file string) (string, error) {
|
2023-07-03 12:16:58 +00:00
|
|
|
client := gosseract.NewClient()
|
|
|
|
defer client.Close()
|
|
|
|
client.SetImage(file)
|
2023-08-15 09:25:49 +00:00
|
|
|
text, err := client.Text()
|
|
|
|
return text, err
|
2023-07-03 12:16:58 +00:00
|
|
|
}
|