media

package
v2.0.0-...-3d53c3d Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidOperation = errors.New("mediatype: invalid operation")
View Source
var ErrInvalidType = errors.New("mediatype: invalid type")

Functions

func CalcSizeMax

func CalcSizeMax(origWidth, origHeight, Width, Height int64) (width int64, height int64)

func CalcSizeMin

func CalcSizeMin(origWidth, origHeight, Width, Height int64) (width int64, height int64)

func FindStringSubmatch

func FindStringSubmatch(exp *regexp.Regexp, str string) map[string]string

Types

type Action

type Action interface {
	Do(master *database.Master, action string, params map[string]string, bucket, path string, reader io.Reader) (*CoreMeta, error)
	Close()
	GetType() string
}

type CoreMeta

type CoreMeta struct {
	Width    int64
	Height   int64
	Duration int64
	Mimetype string
	Format   string
	Size     int64
}

type GenericAction

type GenericAction struct{}

func (*GenericAction) Close

func (ga *GenericAction) Close()

func (*GenericAction) Do

func (ga *GenericAction) Do(meta *CoreMeta, action string, params map[string]string, filename string, reader io.Reader) (*CoreMeta, error)

func (*GenericAction) GetType

func (ga *GenericAction) GetType() string

type ImageAction

type ImageAction struct{}

func NewImageAction

func NewImageAction() (*ImageAction, error)

func (*ImageAction) Close

func (ia *ImageAction) Close()

func (*ImageAction) Do

func (ia *ImageAction) Do(master *database.Master, action string, params map[string]string, bucket, path string, reader io.Reader) (*CoreMeta, error)

func (*ImageAction) GetType

func (ia *ImageAction) GetType() string

type ImageMagickV3

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

func NewImageMagickV3

func NewImageMagickV3(reader io.Reader) (*ImageMagickV3, error)

func (*ImageMagickV3) Close

func (im *ImageMagickV3) Close()

func (*ImageMagickV3) LoadImage

func (im *ImageMagickV3) LoadImage(reader io.Reader) error

func (*ImageMagickV3) Resize

func (im *ImageMagickV3) Resize(options *ImageOptions) error

func (*ImageMagickV3) StoreImage

func (im *ImageMagickV3) StoreImage(format string) (io.Reader, *CoreMeta, error)

type ImageOptions

type ImageOptions struct {
	Width, Height                       int64
	ActionType                          string
	TargetFormat                        string
	OverlayCollection, OverlaySignature string
	BackgroundColor                     string
}

type ImageType

type ImageType interface {
	LoadImage(reader io.Reader) error
	StoreImage(format string) (io.Reader, *CoreMeta, error)
	Resize(options *ImageOptions) error
	Close()
}

type ImageVips

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

func NewImageVips

func NewImageVips(reader io.Reader) (*ImageVips, error)

func (*ImageVips) Close

func (it *ImageVips) Close()

func (*ImageVips) GetType

func (im *ImageVips) GetType() string

func (*ImageVips) LoadImage

func (it *ImageVips) LoadImage(reader io.Reader) error

func (*ImageVips) Resize

func (it *ImageVips) Resize(options *ImageOptions) (err error)

func (*ImageVips) StoreImage

func (it *ImageVips) StoreImage(format string) (io.Reader, *CoreMeta, error)

Jump to

Keyboard shortcuts

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