diff --git a/pkg/migration/20211212210054.go b/pkg/migration/20211212210054.go index a85503162..98e5084c8 100644 --- a/pkg/migration/20211212210054.go +++ b/pkg/migration/20211212210054.go @@ -17,6 +17,7 @@ package migration import ( + "errors" "image" "code.vikunja.io/api/pkg/files" @@ -64,9 +65,12 @@ func init() { } src, _, err := image.Decode(bgFile.File) - if err != nil { + if err != nil && !errors.Is(err, image.ErrFormat) { return err } + if err != nil && errors.Is(err, image.ErrFormat) { + log.Warningf("Could not generate a blur hash of list %d's background image: %s", l.ID, err) + } dst := image.NewRGBA(image.Rect(0, 0, 32, 32)) draw.NearestNeighbor.Scale(dst, dst.Rect, src, src.Bounds(), draw.Over, nil) diff --git a/pkg/modules/background/handler/background.go b/pkg/modules/background/handler/background.go index 282e0578d..dc57b23b5 100644 --- a/pkg/modules/background/handler/background.go +++ b/pkg/modules/background/handler/background.go @@ -17,10 +17,15 @@ package handler import ( - "image" _ "image/gif" // To make sure the decoder used for generating blurHashes recognizes gifs _ "image/jpeg" // To make sure the decoder used for generating blurHashes recognizes jpgs _ "image/png" // To make sure the decoder used for generating blurHashes recognizes pngs + + _ "golang.org/x/image/bmp" // To make sure the decoder used for generating blurHashes recognizes bmps + _ "golang.org/x/image/tiff" // To make sure the decoder used for generating blurHashes recognizes tiffs + _ "golang.org/x/image/webp" // To make sure the decoder used for generating blurHashes recognizes tiffs + + "image" "io" "net/http" "strconv"