vipsprocessor

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 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 GetPageN added in v0.8.0

func GetPageN(ctx context.Context) int

func IsAnimated added in v0.8.0

func IsAnimated(ctx context.Context) bool

func IsRotate90 added in v0.9.8

func IsRotate90(ctx context.Context) bool

func SetPageN added in v0.8.0

func SetPageN(ctx context.Context, n int)

func SetRotate90 added in v0.9.8

func SetRotate90(ctx context.Context)

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 WithLogger

func WithLogger(logger *zap.Logger) Option

func WithMaxAnimationFrames added in v0.8.0

func WithMaxAnimationFrames(num int) 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 WithMaxResolution added in v0.9.12

func WithMaxResolution(res int) Option

func WithMaxWidth added in v0.5.0

func WithMaxWidth(width int) Option

func WithMozJPEG added in v0.8.7

func WithMozJPEG(enabled bool) Option

type VipsProcessor

type VipsProcessor struct {
	Filters            FilterMap
	DisableBlur        bool
	DisableFilters     []string
	MaxFilterOps       int
	Logger             *zap.Logger
	Concurrency        int
	MaxCacheFiles      int
	MaxCacheMem        int
	MaxCacheSize       int
	MaxWidth           int
	MaxHeight          int
	MaxResolution      int
	MaxAnimationFrames int
	MozJPEG            bool
	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