vipsprocessor

package
v0.7.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddImageRef added in v0.7.1

func AddImageRef(ctx context.Context, img *vips.ImageRef)

AddImageRef context add vips image ref for keeping track of gc

func CloseImageRefs added in v0.7.3

func CloseImageRefs(ctx context.Context)

CloseImageRefs closes all image refs that are being tracked through the context

func WithInitImageRefs added in v0.7.3

func WithInitImageRefs(ctx context.Context) context.Context

WithInitImageRefs context with image ref tracking

Types

type FilterFunc

type FilterFunc func(ctx context.Context, img *vips.ImageRef, load imagor.LoadFunc, args ...string) (err error)

type FilterMap

type FilterMap map[string]FilterFunc

type Option

type Option func(v *VipsProcessor)

func WithConcurrency added in v0.2.11

func WithConcurrency(num int) Option

func WithDebug

func WithDebug(debug bool) Option

func WithDisableBlur

func WithDisableBlur(disabled bool) Option

func WithDisableFilters

func WithDisableFilters(filters ...string) Option

func WithFilter

func WithFilter(name string, filter FilterFunc) Option

func WithLoadFromFile added in v0.5.3

func WithLoadFromFile(enabled bool) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithMaxCacheFiles added in v0.2.9

func WithMaxCacheFiles(num int) Option

func WithMaxCacheMem added in v0.2.9

func WithMaxCacheMem(num int) Option

func WithMaxCacheSize added in v0.2.9

func WithMaxCacheSize(num int) Option

func WithMaxFilterOps

func WithMaxFilterOps(num int) Option

func WithMaxHeight added in v0.5.0

func WithMaxHeight(height int) Option

func WithMaxWidth added in v0.5.0

func WithMaxWidth(width int) Option

type VipsProcessor

type VipsProcessor struct {
	Filters        FilterMap
	LoadFromFile   bool
	DisableBlur    bool
	DisableFilters []string
	MaxFilterOps   int
	Logger         *zap.Logger
	Concurrency    int
	MaxCacheFiles  int
	MaxCacheMem    int
	MaxCacheSize   int
	MaxWidth       int
	MaxHeight      int
	Debug          bool
}

func New

func New(options ...Option) *VipsProcessor

func (*VipsProcessor) Process

func (v *VipsProcessor) Process(
	ctx context.Context, blob *imagor.Blob, p imagorpath.Params, load imagor.LoadFunc,
) (*imagor.Blob, error)

func (*VipsProcessor) Shutdown

func (v *VipsProcessor) Shutdown(_ context.Context) error

func (*VipsProcessor) Startup

func (v *VipsProcessor) Startup(_ context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL