From 6c8535c54a9033e546a4a82ef80bd2bfc2dc921f Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 21 Aug 2020 11:33:23 -0400 Subject: [PATCH] Add support for reading webp artwork --- consts/mime_types.go | 1 + core/artwork.go | 2 ++ go.mod | 1 + 3 files changed, 4 insertions(+) diff --git a/consts/mime_types.go b/consts/mime_types.go index cb15d32e..9a4522e2 100644 --- a/consts/mime_types.go +++ b/consts/mime_types.go @@ -25,6 +25,7 @@ func init() { ".gif": "image/gif", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", + ".webp": "image/webp", ".png": "image/png", ".bmp": "image/bmp", } diff --git a/core/artwork.go b/core/artwork.go index aae45832..56abc337 100644 --- a/core/artwork.go +++ b/core/artwork.go @@ -14,6 +14,8 @@ import ( "strings" "time" + _ "golang.org/x/image/webp" + "github.com/deluan/navidrome/conf" "github.com/deluan/navidrome/consts" "github.com/deluan/navidrome/log" diff --git a/go.mod b/go.mod index 868b3893..af6ae49b 100644 --- a/go.mod +++ b/go.mod @@ -35,6 +35,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.7.1 + golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect golang.org/x/text v0.3.3 // indirect