feat: imagorvideo init
This commit is contained in:
commit
2451fa1b5a
20 changed files with 2601 additions and 0 deletions
23
config.go
Normal file
23
config.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package imagorvideo
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"github.com/cshum/imagor"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func Config(fs *flag.FlagSet, cb func() (*zap.Logger, bool)) imagor.Option {
|
||||
var (
|
||||
ffmpegFallbackImage = fs.String("ffmpeg-fallback-image", "",
|
||||
"FFmpeg fallback image on processing error. Supports image path enabled by loaders or storages")
|
||||
|
||||
logger, isDebug = cb()
|
||||
)
|
||||
return imagor.WithProcessors(
|
||||
NewProcessor(
|
||||
WithFallbackImage(*ffmpegFallbackImage),
|
||||
WithLogger(logger),
|
||||
WithDebug(isDebug),
|
||||
),
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue