From fbf543bddaff3b8e2463e41cd14327b994f8882c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E6=B3=93=E9=93=AE?= Date: Fri, 11 Jul 2025 17:14:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E8=BF=87=E9=95=BF=EF=BC=8C=E5=B9=B6=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=9C=89=E6=95=88=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uixt/ai/cv_vedem.go | 8 +++++--- uixt/driver_ext_screenshot.go | 3 --- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/uixt/ai/cv_vedem.go b/uixt/ai/cv_vedem.go index 2cb4a833..e26068c5 100644 --- a/uixt/ai/cv_vedem.go +++ b/uixt/ai/cv_vedem.go @@ -49,7 +49,8 @@ func NewVEDEMImageService() (*vedemCVService, error) { type vedemCVService struct{} func (s *vedemCVService) ReadFromPath(imagePath string, opts ...option.ActionOption) ( - imageResult *CVResult, err error) { + imageResult *CVResult, err error, +) { imageBuf, err := os.ReadFile(imagePath) if err != nil { err = errors.Wrap(code.CVPrepareRequestError, @@ -61,7 +62,8 @@ func (s *vedemCVService) ReadFromPath(imagePath string, opts ...option.ActionOpt } func (s *vedemCVService) ReadFromBuffer(imageBuf *bytes.Buffer, opts ...option.ActionOption) ( - imageResult *CVResult, err error) { + imageResult *CVResult, err error, +) { actionOptions := option.NewActionOptions(opts...) log.Debug().Interface("options", actionOptions).Msg("vedem.ReadFromBuffer") screenshotActions := actionOptions.List() @@ -77,7 +79,7 @@ func (s *vedemCVService) ReadFromBuffer(imageBuf *bytes.Buffer, opts ...option.A if err != nil { logger = log.Error().Err(err) } else { - logger = log.Debug() + logger = log.Info() if imageResult.URL != "" { logger = logger.Str("url", imageResult.URL) } diff --git a/uixt/driver_ext_screenshot.go b/uixt/driver_ext_screenshot.go index f6500b65..b5bb07f9 100644 --- a/uixt/driver_ext_screenshot.go +++ b/uixt/driver_ext_screenshot.go @@ -176,9 +176,6 @@ func (dExt *XTDriver) GetScreenTexts(opts ...option.ActionOption) (ocrTexts ai.O func (dExt *XTDriver) FindScreenText(text string, opts ...option.ActionOption) (textRect ai.OCRText, err error) { options := option.NewActionOptions(opts...) - if options.ScreenShotFileName == "" { - opts = append(opts, option.WithScreenShotFileName(fmt.Sprintf("find_screen_text_%s", text))) - } // convert relative scope to absolute scope if options.AbsScope == nil && len(options.Scope) == 4 {