feat: imagorvideo init

This commit is contained in:
Adrian Shum 2022-09-08 20:44:10 +08:00
commit 2451fa1b5a
20 changed files with 2601 additions and 0 deletions

23
config.go Normal file
View 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),
),
)
}