summaryrefslogtreecommitdiff
path: root/internal/media/processingmedia.go
diff options
context:
space:
mode:
authorLibravatar Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>2022-12-06 14:15:25 +0100
committerLibravatar GitHub <noreply@github.com>2022-12-06 14:15:25 +0100
commit1a3f26fb5c515f5672561449f91f6be6383b5a3a (patch)
tree801c8469ea8ae122cf583953940d3e28bdbfa90f /internal/media/processingmedia.go
parent[docs] Remove filesystem logging directives from example systemd unit config ... (diff)
downloadgotosocial-1a3f26fb5c515f5672561449f91f6be6383b5a3a.tar.xz
[feature] media: add webp support (#1155)
* media: add webp support Signed-off-by: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se> * bump exif-terminator to v0.5.0 Signed-off-by: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se> Signed-off-by: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
Diffstat (limited to 'internal/media/processingmedia.go')
-rw-r--r--internal/media/processingmedia.go4
1 files changed, 2 insertions, 2 deletions
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)