refactor: init CV service

This commit is contained in:
lilong.129
2025-07-01 22:53:50 +08:00
parent 17d9d85686
commit 2b32e17091
2 changed files with 26 additions and 13 deletions
+4
View File
@@ -114,6 +114,10 @@ func (dExt *XTDriver) createScreenshotWithSession(opts ...option.ActionOption) (
logger := log.Debug().Str("imagePath", imagePath)
// perform CV processing if any CV-related option is enabled
if needsCVProcessing(screenshotOptions) {
if err = dExt.initCVService(); err != nil {
return nil, err
}
imageResult, err := dExt.CVService.ReadFromBuffer(compressBufSource, opts...)
if err != nil {
log.Error().Err(err).Msg("ReadFromBuffer from ImageService failed")