transformation

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 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.Step, 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) Run

type GoogleTagger

type GoogleTagger struct {
}

func NewGoogleTagger

func NewGoogleTagger(c GoogleTaggerConfig) *GoogleTagger

func (*GoogleTagger) Run

type GoogleTaggerConfig

type GoogleTaggerConfig struct {
}

type MediaOptimization

type MediaOptimization struct {
}

func NewMediaOptimization

func NewMediaOptimization() *MediaOptimization

func (*MediaOptimization) GetSteps

func (o *MediaOptimization) GetSteps(contentType media.ContentType) ([]pipeline.Step, 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 NamedTransformationReplacer

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

func (*NamedTransformationReplacer) Replace

func (r *NamedTransformationReplacer) Replace(transformations string) (*string, error)

type NamedTransformationReplacerConfig

type NamedTransformationReplacerConfig struct {
	NamedTransformationStorage Storer
}

type NamedTransformations

type NamedTransformations = map[string]NamedTransformation

type OverlaySinkerFunc

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

type Parser

type Parser struct {
}

func NewParser

func NewParser() Parser

func (*Parser) Parse

func (p *Parser) Parse(str string) ([]Transformation, error)

type Scaler

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

func NewScaler

func NewScaler(opts ...ScalerOptions) *Scaler

func (*Scaler) Run

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() (NamedTransformations, 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 Watermarker

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

func NewWatermarker

func NewWatermarker(c WatermarkerConfig) *Watermarker

func (*Watermarker) Run

type WatermarkerConfig

type WatermarkerConfig struct {
	Size          types.Size
	Anchor        types.Anchor
	Padding       int
	OverlaySinker OverlaySinkerFunc
}

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) Run

Jump to

Keyboard shortcuts

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