From 6f90d5c56b05f05002a4527cdc6a0208f38386e1 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Tue, 17 Nov 2020 12:53:43 +0100 Subject: [PATCH] Thumbnail jpgs as jpgs to not increase thumbnail size --- thumbnailing/i/jpg.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thumbnailing/i/jpg.go b/thumbnailing/i/jpg.go index 4b646dc7..d166b050 100644 --- a/thumbnailing/i/jpg.go +++ b/thumbnailing/i/jpg.go @@ -51,13 +51,13 @@ func (d jpgGenerator) GenerateThumbnail(b []byte, contentType string, width int, } imgData := &bytes.Buffer{} - err = imaging.Encode(imgData, thumb, imaging.PNG) + err = imaging.Encode(imgData, thumb, imaging.JPEG) if err != nil { return nil, errors.New("jpg: error encoding thumbnail: " + err.Error()) } return &m.Thumbnail{ Animated: false, - ContentType: "image/png", + ContentType: "image/jpeg", Reader: ioutil.NopCloser(imgData), }, nil }