From 0e72832dcf6bdabef40217dc28b775af03a9f807 Mon Sep 17 00:00:00 2001 From: Wendal Chen Date: Mon, 19 Sep 2022 17:49:25 +0800 Subject: [PATCH] fix: https://github.com/cloudreve/Cloudreve/issues/1461 --- pkg/thumb/image.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/thumb/image.go b/pkg/thumb/image.go index 69c73a3b..d975e4c4 100644 --- a/pkg/thumb/image.go +++ b/pkg/thumb/image.go @@ -7,6 +7,7 @@ import ( "image/gif" "image/jpeg" "image/png" + "golang.org/x/image/webp" "io" "path/filepath" "strings" @@ -44,6 +45,8 @@ func NewThumbFromFile(file io.Reader, name string) (*Thumb, error) { img, err = gif.Decode(file) case "png": img, err = png.Decode(file) + case "webp": + img, err = webp.Decode(file) default: return nil, errors.New("未知的图像类型") }