transform

package
v0.0.0-...-1b0f315 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const NamedTransformationPrefix = "t_"

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(dataStorage media.FileStorer) Builder

func (*Builder) Build

func (b *Builder) Build(ts []Transformation) ([]pipeline.PipelineStep, error)

type CropStrategy

type CropStrategy string
var (
	PadResizeCrop CropStrategy = "pad_resize_crop"
	ForcedCrop    CropStrategy = "forced_crop"
)

func ArgToCropStrategy

func ArgToCropStrategy(arg string) CropStrategy

type ExifReader

type ExifReader struct {
}

func NewExifReader

func NewExifReader() ExifReader

func (*ExifReader) Execute

type GoogleTagger

type GoogleTagger struct {
}

func NewGoogleTagger

func NewGoogleTagger() GoogleTagger

func (*GoogleTagger) Run

type MediaOptimization

type MediaOptimization struct {
}

func NewMediaOptimization

func NewMediaOptimization() *MediaOptimization

func (*MediaOptimization) GetSteps

func (o *MediaOptimization) GetSteps(contentType media.ContentType) ([]pipeline.PipelineStep, error)

type NamedTransformation

type NamedTransformation struct {
	Name            string    `json:"name" yaml:"name"`
	Transformations string    `json:"transformations" yaml:"transformations"`
	CreatedAt       time.Time `json:"created_at,omitempty"`
	UpdatedAt       time.Time `json:"updated_at,omitempty"`
}

type NamedTransformationMap

type NamedTransformationMap = map[string]NamedTransformation

type OverlaySinkerFunc

type OverlaySinkerFunc = func() (media.Body, error)

type Scaler

type Scaler struct {
	// contains filtered or unexported fields
}

func NewScaler

func NewScaler(opts ...ScalerOptions) Scaler

func (*Scaler) Execute

func (r *Scaler) Execute(ctx pipeline.PipelineCtx) (pipeline.PipelineCtx, error)

type ScalerConfig

type ScalerConfig struct {
	Size         types.Size
	CropStrategy CropStrategy
	PadColor     color.RGBA
}

type ScalerFactory

type ScalerFactory struct {
}

func (*ScalerFactory) Build

func (f *ScalerFactory) Build(args map[string]string) (*Scaler, error)

type ScalerOptions

type ScalerOptions func(*scalerOptions)

func WithCropStrategy

func WithCropStrategy(cropStrategy CropStrategy) ScalerOptions

func WithPadColor

func WithPadColor(padColor color.RGBA) ScalerOptions

func WithSize

func WithSize(size types.Size) ScalerOptions

type Storer

type Storer interface {
	GetAll() (NamedTransformationMap, error)
	Get(name string) (*NamedTransformation, error)
	Save(t NamedTransformation) error
	Delete(name string) error
	DeleteAll() error
}

type Transformation

type Transformation struct {
	Name string
	Args map[string]string
}

func NewTransformation

func NewTransformation(c Transformation) Transformation

func (*Transformation) IsSame

func (t *Transformation) IsSame(name string) bool

func (*Transformation) ToString

func (t *Transformation) ToString() string

type Watermark

type Watermark struct {
	Watermark media.Path
	Size      types.Size
	Anchor    types.Anchor
	Padding   string
}

type Watermarker

type Watermarker struct {
	// contains filtered or unexported fields
}

func NewWatermarker

func NewWatermarker(size types.Size, anchor types.Anchor, padding int, overlaySinker OverlaySinkerFunc) Watermarker

func (*Watermarker) Execute

type WatermarkerFactory

type WatermarkerFactory struct {
	// contains filtered or unexported fields
}

func NewWatermarkerFactory

func NewWatermarkerFactory(dataStorage media.FileStorer) WatermarkerFactory

func (*WatermarkerFactory) Build

func (f *WatermarkerFactory) Build(args map[string]string) (*Watermarker, error)

type WebpConverter

type WebpConverter struct {
}

func NewWebpConverter

func NewWebpConverter() WebpConverter

func (*WebpConverter) Execute

Jump to

Keyboard shortcuts

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