feat: cache screenshot ocr texts

This commit is contained in:
lilong.129
2023-04-28 11:44:47 +08:00
parent c0ea52d02a
commit 9981dad1f8
9 changed files with 56 additions and 35 deletions
+3 -1
View File
@@ -279,7 +279,8 @@ type IOCRService interface {
func (dExt *DriverExt) GetScreenTextsByOCR() (texts OCRTexts, err error) {
var bufSource *bytes.Buffer
if bufSource, err = dExt.TakeScreenShot(
var imagePath string
if bufSource, imagePath, err = dExt.TakeScreenShot(
builtin.GenNameWithTimestamp("%d_ocr")); err != nil {
return
}
@@ -290,6 +291,7 @@ func (dExt *DriverExt) GetScreenTextsByOCR() (texts OCRTexts, err error) {
return
}
dExt.stepScreenShots[imagePath] = ocrTexts
return ocrTexts, nil
}