diff options
Diffstat (limited to 'internal/media/processingemoji.go')
-rw-r--r-- | internal/media/processingemoji.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/internal/media/processingemoji.go b/internal/media/processingemoji.go index 89a1bcc91..18d7895fd 100644 --- a/internal/media/processingemoji.go +++ b/internal/media/processingemoji.go @@ -216,10 +216,18 @@ 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" + // Copy temporary file into storage at path. filesz, err := p.mgr.state.Storage.PutFile(ctx, p.emoji.ImagePath, temppath, + p.emoji.ImageContentType, ) if err != nil { return gtserror.Newf("error writing emoji to storage: %w", err) @@ -229,6 +237,7 @@ func (p *ProcessingEmoji) store(ctx context.Context) error { staticsz, err := p.mgr.state.Storage.PutFile(ctx, p.emoji.ImageStaticPath, staticpath, + p.emoji.ImageStaticContentType, ) if err != nil { return gtserror.Newf("error writing static to storage: %w", err) @@ -256,13 +265,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" - // We can now consider this cached. p.emoji.Cached = util.Ptr(true) |