processor

package
v0.0.0-...-e9492ee Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package processor Handle image processing, including resizing, converting and stripping unwanted metadata.

Package processor Add support for imaginary imge processing service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImaginaryProcessor

type ImaginaryProcessor struct {
	URL string
	// contains filtered or unexported fields
}

ImaginaryProcessor define imaginary processor settings.

func NewImaginary

func NewImaginary(conf config.Config) (*ImaginaryProcessor, error)

NewImaginary instantiate a new imaginary instance with given config.

func (*ImaginaryProcessor) Optimize

func (ip *ImaginaryProcessor) Optimize(media []byte, of string, tf string, q, width int) ([]byte, string, error)

Optimize method to process image with imaginary with given parameters.

type LocalProcessor

type LocalProcessor struct{}

LocalProcessor process images directly in traefik itself, unsupported with interpreter limitations.

func (*LocalProcessor) Optimize

func (lp *LocalProcessor) Optimize(media []byte, of string, tf string, q, w int) ([]byte, string, error)

Optimize optimize image with given params.

type NoneProcessor

type NoneProcessor struct{}

NoneProcessor dummy processor, using null pattern.

func (*NoneProcessor) Optimize

func (lp *NoneProcessor) Optimize(media []byte, of string, tf string, q, w int) ([]byte, string, error)

Optimize return same data from media.

type Processor

type Processor interface {
	Optimize(media []byte, originalFormat string, targetFormat string, quality, width int) ([]byte, string, error)
}

Processor Define processor interface.

func New

func New(conf config.Config) (Processor, error)

New Processor factory from dynamic configurations.

Jump to

Keyboard shortcuts

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