mirror of
https://github.com/go-shiori/shiori.git
synced 2025-09-06 04:54:59 +08:00
fix: allow webp thumbnails (#758)
* use webp as thumbnail * simpler way to use webp --------- Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
This commit is contained in:
parent
1ae82f48a3
commit
03df5e8399
2 changed files with 3 additions and 1 deletions
2
go.mod
2
go.mod
|
@ -34,6 +34,7 @@ require (
|
|||
github.com/swaggo/swag v1.16.2
|
||||
github.com/toorop/gin-logrus v0.0.0-20210225092905-2c785434f26f
|
||||
golang.org/x/crypto v0.13.0
|
||||
golang.org/x/image v0.12.0
|
||||
golang.org/x/net v0.15.0
|
||||
golang.org/x/term v0.12.0
|
||||
modernc.org/sqlite v1.26.0
|
||||
|
@ -86,7 +87,6 @@ require (
|
|||
go.etcd.io/bbolt v1.3.7 // indirect
|
||||
go.uber.org/atomic v1.11.0 // indirect
|
||||
golang.org/x/arch v0.5.0 // indirect
|
||||
golang.org/x/image v0.12.0 // indirect
|
||||
golang.org/x/mod v0.12.0 // indirect
|
||||
golang.org/x/sys v0.12.0 // indirect
|
||||
golang.org/x/text v0.13.0 // indirect
|
||||
|
|
|
@ -21,6 +21,7 @@ import (
|
|||
"github.com/go-shiori/shiori/internal/model"
|
||||
"github.com/go-shiori/warc"
|
||||
"github.com/pkg/errors"
|
||||
_ "golang.org/x/image/webp"
|
||||
|
||||
// Add support for png
|
||||
_ "image/png"
|
||||
|
@ -204,6 +205,7 @@ func DownloadBookImage(url, dstPath string) error {
|
|||
if !strings.Contains(cp, "image/jpeg") &&
|
||||
!strings.Contains(cp, "image/pjpeg") &&
|
||||
!strings.Contains(cp, "image/jpg") &&
|
||||
!strings.Contains(cp, "image/webp") &&
|
||||
!strings.Contains(cp, "image/png") {
|
||||
return ErrNoSupportedImageType
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue