diff --git a/CHANGELOG.md b/CHANGELOG.md index 54996054..28ecc61c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * Swap out the HEIF library for better support towards [ARM64 Docker Images](https://github.com/turt2live/matrix-media-repo/issues/365). * The development environment now uses Synapse as a homeserver. Test accounts will need recreating. * Updated to Go 1.18 +* Improved error message when thumbnailer cannot determine image dimensions. ### Fixed diff --git a/thumbnailing/thumbnail.go b/thumbnailing/thumbnail.go index 42bcaa03..2d124592 100644 --- a/thumbnailing/thumbnail.go +++ b/thumbnailing/thumbnail.go @@ -2,11 +2,12 @@ package thumbnailing import ( "errors" - "github.com/turt2live/matrix-media-repo/common" "io" "io/ioutil" "reflect" + "github.com/turt2live/matrix-media-repo/common" + "github.com/turt2live/matrix-media-repo/common/rcontext" "github.com/turt2live/matrix-media-repo/thumbnailing/i" "github.com/turt2live/matrix-media-repo/thumbnailing/m" @@ -45,7 +46,7 @@ func GenerateThumbnail(imgStream io.ReadCloser, contentType string, width int, h // https://github.com/turt2live/matrix-media-repo/security/advisories/GHSA-j889-h476-hh9h dimensional, w, h, err := generator.GetOriginDimensions(b, contentType, ctx) if err != nil { - return nil, err + return nil, errors.New("error getting dimensions: " + err.Error()) } if dimensional && (w*h) >= ctx.Config.Thumbnails.MaxPixels { ctx.Log.Warn("Image too large: too many pixels")