mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-13 17:37:27 -06:00
[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>
This commit is contained in:
parent
f9e5ec99bd
commit
1a3f26fb5c
26 changed files with 4348 additions and 19 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue