diff options
author | 2024-11-04 13:58:15 +0000 | |
---|---|---|
committer | 2024-11-04 14:58:15 +0100 | |
commit | 8f288f1689376a8cf6ab7f431e862eb870765342 (patch) | |
tree | 42442833af06948eb3ec9f7710ed35b809cd6992 /internal/media/processingemoji.go | |
parent | [chore]: Bump github.com/minio/minio-go/v7 from 7.0.79 to 7.0.80 (#3511) (diff) | |
download | gotosocial-8f288f1689376a8cf6ab7f431e862eb870765342.tar.xz |
[bugfix] determine mime-type to use during ffprobe evaluation stage, don't bother checking against file extension (#3506)
* determine mime-type to use during ffprobe evaluation stage, don't bother rechecking by file extension
* set mjpeg content-type
* fix up tests expecting differing default values
Diffstat (limited to 'internal/media/processingemoji.go')
-rw-r--r-- | internal/media/processingemoji.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/internal/media/processingemoji.go b/internal/media/processingemoji.go index 750144296..95c224cda 100644 --- a/internal/media/processingemoji.go +++ b/internal/media/processingemoji.go @@ -163,9 +163,10 @@ func (p *ProcessingEmoji) store(ctx context.Context) error { } var ext string + var fileType gtsmodel.FileType - // Get type from ffprobe format data. - fileType, ext := result.GetFileType() + // Get abstract file type, mimetype and ext from ffprobe data. + fileType, p.emoji.ImageContentType, ext = result.GetFileType() if fileType != gtsmodel.FileTypeImage { return gtserror.Newf("unsupported emoji filetype: %s (%s)", fileType, ext) } @@ -216,10 +217,6 @@ func (p *ProcessingEmoji) store(ctx context.Context) error { "png", ) - // Get mimetype for the file container - // type, falling back to generic data. - p.emoji.ImageContentType = getMimeType(ext) - // Set the known emoji static content type. p.emoji.ImageStaticContentType = "image/png" |