Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wendal committed Sep 19, 2022
1 parent 846438e commit 0e72832
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/thumb/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"image/gif"
"image/jpeg"
"image/png"
"golang.org/x/image/webp"
"io"
"path/filepath"
"strings"
Expand Down Expand Up @@ -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("未知的图像类型")
}
Expand Down

0 comments on commit 0e72832

Please sign in to comment.