From 8f288f1689376a8cf6ab7f431e862eb870765342 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:58:15 +0000 Subject: [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 --- internal/media/processingemoji.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'internal/media/processingemoji.go') 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" -- cgit v1.2.3