From 1a3f26fb5c515f5672561449f91f6be6383b5a3a Mon Sep 17 00:00:00 2001 From: Sigrid Solveig Haflínudóttir Date: Tue, 6 Dec 2022 14:15:25 +0100 Subject: [feature] media: add webp support (#1155) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * media: add webp support Signed-off-by: Sigrid Solveig Haflínudóttir * bump exif-terminator to v0.5.0 Signed-off-by: Sigrid Solveig Haflínudóttir Signed-off-by: Sigrid Solveig Haflínudóttir --- internal/media/processingmedia.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/media/processingmedia.go') diff --git a/internal/media/processingmedia.go b/internal/media/processingmedia.go index 81eef2f84..1fd9423f5 100644 --- a/internal/media/processingmedia.go +++ b/internal/media/processingmedia.go @@ -215,7 +215,7 @@ func (p *ProcessingMedia) loadFullSize(ctx context.Context) error { // decode the image ct := p.attachment.File.ContentType switch ct { - case mimeImageJpeg, mimeImagePng: + case mimeImageJpeg, mimeImagePng, mimeImageWebp: decoded, err = decodeImage(stored, ct) case mimeImageGif: decoded, err = decodeGif(stored) @@ -319,7 +319,7 @@ func (p *ProcessingMedia) store(ctx context.Context) error { p.attachment.Type = gtsmodel.FileTypeImage // nothing to terminate, we can just store the multireader readerToStore = multiReader - case mimeJpeg, mimePng: + case mimeJpeg, mimePng, mimeWebp: p.attachment.Type = gtsmodel.FileTypeImage if fileSize > 0 { terminated, err := terminator.Terminate(multiReader, int(fileSize), extension) -- cgit v1.2.3