From c4cf4c9d837e575627a58153ad3c7179934604a7 Mon Sep 17 00:00:00 2001 From: "xucong.053" Date: Tue, 27 Dec 2022 17:47:44 +0800 Subject: [PATCH] fix: unittest --- hrp/pkg/uixt/algorithm.go | 5 ++++- hrp/pkg/uixt/im_vedem.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hrp/pkg/uixt/algorithm.go b/hrp/pkg/uixt/algorithm.go index d7721853..00a5d83e 100644 --- a/hrp/pkg/uixt/algorithm.go +++ b/hrp/pkg/uixt/algorithm.go @@ -64,7 +64,10 @@ type ImageTemplate struct { } func NewImageTemplate(filepath string) ImageTemplate { - return ImageTemplate{FilePath: filepath} + return ImageTemplate{ + FilePath: filepath, + rawBuffer: bytes.NewBuffer([]byte{}), + } } func (i *ImageTemplate) read() (imageBuffer *bytes.Buffer, err error) { diff --git a/hrp/pkg/uixt/im_vedem.go b/hrp/pkg/uixt/im_vedem.go index 24b19342..da57def9 100644 --- a/hrp/pkg/uixt/im_vedem.go +++ b/hrp/pkg/uixt/im_vedem.go @@ -58,7 +58,7 @@ func checkIMEnv() error { } func convertBase64(imgByte []byte) (baseImg string) { - return base64.StdEncoding.EncodeToString(imgByte) + return base64.RawStdEncoding.EncodeToString(imgByte) } func (s *veDEMIMService) getIMResult(searchImage []byte, sourceImage []byte) ([]IMResult, error) {