add tesseract support

This commit is contained in:
arya committed 2023-07-03 17:46:58 +05:30
1 parent feb3baef9e
commit f89cf56d86
5 files changed
+47 -1

No files matched your search

-1
View File
@@ -3,7 +3,6 @@ package utils
import (
"github.com/gocolly/colly"
"os"
"strings"
)
func TranslateGoogle(to string, from string, query string) string {
+13
View File
@@ -0,0 +1,13 @@
package utils
import (
"github.com/otiai10/gosseract/v2"
)
func ImgTxt(file string) string {
client := gosseract.NewClient()
defer client.Close()
client.SetImage(file)
text, _ := client.Text()
return text
}