webp fix v1
This commit is contained in:
+12
-1
@@ -14,6 +14,15 @@ import (
|
||||
// MaxUploadBytes 与真实实现保持一致(8MB 单图上限,bodylimit 中间件依赖此值语义)。
|
||||
const MaxUploadBytes = 8 * 1024 * 1024
|
||||
|
||||
// EncodeSpec 与真实实现的编码档位结构保持字段一致。
|
||||
type EncodeSpec struct {
|
||||
MaxSide int
|
||||
Quality float32
|
||||
}
|
||||
|
||||
// GeneralEncodeSpec 与真实实现保持一致(route/question 引用)。
|
||||
var GeneralEncodeSpec = EncodeSpec{MaxSide: 1600, Quality: 80}
|
||||
|
||||
func UploadPictureToS3(file multipart.File, fileHeader *multipart.FileHeader) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
@@ -26,6 +35,8 @@ func UploadBackgroundToS3(file multipart.File, fileHeader *multipart.FileHeader)
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func ConvertStaticImageToWebP(r io.Reader) ([]byte, error) { return nil, nil }
|
||||
func ConvertStaticImageToWebP(r io.Reader, spec EncodeSpec) ([]byte, error) { return nil, nil }
|
||||
|
||||
func ConvertGifToAnimatedWebP(gifData []byte) ([]byte, error) { return nil, nil }
|
||||
|
||||
func isSupportedImage(data []byte) bool { return true }
|
||||
|
||||
Reference in New Issue
Block a user