Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop

This commit is contained in:
eson 2023-06-02 11:55:54 +08:00
commit 271432953d
2 changed files with 4 additions and 8 deletions

View File

@ -4,10 +4,9 @@ import (
"context" "context"
"errors" "errors"
"fusenapi/model" "fusenapi/model"
"fusenapi/utils/image"
"fusenapi/product/internal/svc" "fusenapi/product/internal/svc"
"fusenapi/product/internal/types" "fusenapi/product/internal/types"
"fusenapi/utils/image"
"github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/core/logx"
) )

View File

@ -14,15 +14,12 @@ func GetCurrentSize(clientSize uint32) uint32 {
} }
//小于最小尺寸则返回规则最小尺寸 //小于最小尺寸则返回规则最小尺寸
if clientSize < newSizeArray[0] { if clientSize < newSizeArray[0] {
return clientSize return newSizeArray[0]
} }
for k, v := range newSizeArray { for _, v := range newSizeArray {
if v == clientSize { if v >= clientSize {
return v return v
} }
if clientSize > v && k < lenNewSize-1 && clientSize < newSizeArray[k+1] {
return newSizeArray[k+1]
}
} }
return clientSize return clientSize
} }