mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-28 15:23:32 -06:00
[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
This commit is contained in:
parent
d2820a1470
commit
8f288f1689
16 changed files with 85 additions and 1378 deletions
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue