webp fix v1
This commit is contained in:
+10
-3
@@ -1,6 +1,7 @@
|
||||
// webpstub(package webp)是 chai2010/webp 的本地编译桩:仅用于在缺少 libwebp 的
|
||||
// Windows 沙箱中通过 `go build -overlay` 对依赖 internal/storage 的包做完整
|
||||
// 类型检查。API 只覆盖项目实际用到的 Encode/Options。
|
||||
// Windows 沙箱中通过 `go build -overlay` 替换 chai2010/webp 的全部源文件,
|
||||
// 从而让真实的 internal/storage/s3.go(而非桩)参与完整类型检查。
|
||||
// 仅覆盖项目实际用到的 API。
|
||||
package webp
|
||||
|
||||
import (
|
||||
@@ -8,13 +9,19 @@ import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// Options 与 github.com/chai2010/webp 的 Options 字段保持兼容(项目仅用 Quality)。
|
||||
// Options 与 github.com/chai2010/webp 的 Options 字段保持兼容。
|
||||
type Options struct {
|
||||
Lossless bool
|
||||
Quality float32
|
||||
Exact bool
|
||||
}
|
||||
|
||||
// Encode 是 webp.Encode 的签名兼容桩(类型检查期间不会被真正调用)。
|
||||
func Encode(w io.Writer, m image.Image, o *Options) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DecodeConfig / Decode 保留解码入口签名,供 s3.go 的 image.Decode 分派路径类型检查。
|
||||
func DecodeConfig(r io.Reader) (image.Config, error) { return image.Config{}, nil }
|
||||
|
||||
func Decode(r io.Reader) (image.Image, error) { return nil, nil }
|
||||
|
||||
Reference in New Issue
Block a user