From 4d4996c6f4a3eecbcca0bc6cdcb2d76d308b481f Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Sun, 25 Jun 2023 19:43:17 +0800 Subject: [PATCH] fix --- utils/image/image_size.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/image/image_size.go b/utils/image/image_size.go index 8b975de3..6b568dc5 100644 --- a/utils/image/image_size.go +++ b/utils/image/image_size.go @@ -48,7 +48,7 @@ func ThousandFaceImageFormat(req *ThousandFaceImageFormatReq) { if req.Size > 0 { coverSlice := strings.Split(req.Cover, ".") coverImgSlice := strings.Split(req.CoverImg, ".") - if req.Size >= 200 && len(coverSlice) == 2 && len(coverImgSlice) == 2 { + if req.Size >= 200 && len(coverSlice) >= 2 && len(coverImgSlice) >= 2 { req.Cover = fmt.Sprintf("%s_%d.%s", coverSlice[0], req.Size, coverSlice[1]) req.CoverImg = fmt.Sprintf("%s_%d.%s", coverImgSlice[0], req.Size, coverImgSlice[1]) } @@ -56,7 +56,7 @@ func ThousandFaceImageFormat(req *ThousandFaceImageFormatReq) { if req.IsThousandFace == 1 { req.Cover = "" req.CoverDefault = req.CoverImg - if req.Size >= 200 && len(coverSlice) == 2 && len(coverImgSlice) == 2 { + if req.Size >= 200 && len(coverSlice) >= 2 && len(coverImgSlice) >= 2 { req.CoverImg = fmt.Sprintf("%s/test/%d/%d_%d.png?%d", constants.DOMAIN_RENDER_IMG_NAME, req.UserInfo.Id, req.UserInfo.Id, req.ProductId, time.Now().Unix()) req.CoverDefault = fmt.Sprintf("%s_%d.%s", coverImgSlice[0], req.Size, coverImgSlice[1]) }