feat(thumb): use ffmpeg to generate thumb

This commit is contained in:
Aaron Liu
2023-04-07 19:30:41 +08:00
parent b55344459d
commit 98b86b37de
6 changed files with 112 additions and 8 deletions

View File

@@ -137,7 +137,13 @@ func (fs *FileSystem) GenerateThumbnail(ctx context.Context, file *model.File) e
}
defer source.Close()
thumbPath, err := thumb.Generators.Generate(ctx, source, file.Name, model.GetSettingByNames(
// Provide file source path for local policy files
src := ""
if file.GetPolicy().Type == "local" {
src = file.SourceName
}
thumbPath, err := thumb.Generators.Generate(ctx, source, src, file.Name, model.GetSettingByNames(
"thumb_width",
"thumb_height",
"thumb_builtin_enabled",