mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 11:42:24 -05:00
[bugfix] moves file rename to earlier in media pipeline so ffmpeg calls ALWAYS have extension (#3146)
This commit is contained in:
parent
87ee64afa0
commit
58f8082795
3 changed files with 55 additions and 23 deletions
|
|
@ -19,6 +19,7 @@ package media
|
|||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
|
||||
errorsv2 "codeberg.org/gruf/go-errors/v2"
|
||||
"codeberg.org/gruf/go-runners"
|
||||
|
|
@ -169,6 +170,18 @@ func (p *ProcessingEmoji) store(ctx context.Context) error {
|
|||
return gtserror.Newf("unsupported emoji filetype: %s (%s)", fileType, ext)
|
||||
}
|
||||
|
||||
// Add file extension to path.
|
||||
newpath := temppath + "." + ext
|
||||
|
||||
// Before ffmpeg processing, rename to set file ext.
|
||||
if err := os.Rename(temppath, newpath); err != nil {
|
||||
return gtserror.Newf("error renaming to %s - >%s: %w", temppath, newpath, err)
|
||||
}
|
||||
|
||||
// Update path var
|
||||
// AFTER successful.
|
||||
temppath = newpath
|
||||
|
||||
// Generate a static image from input emoji path.
|
||||
staticpath, err = ffmpegGenerateStatic(ctx, temppath)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue