imaging

package
v1.0.0-rc.2.0...-638eaff Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPixelLimitExceeded = errors.New("the image exceeds max pixels limit")
	ErrInvalidImageSrc    = errors.New("invalid image src")
	ErrTimeout            = errors.New("processing timeout")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// MaxPixels 処理可能な最大画素数
	// この値を超える画素数の画像を処理しようとした場合、全てエラーになります
	MaxPixels int
	// Concurrency 処理並列数
	Concurrency int
	// ThumbnailMaxSize サムネイル画像サイズ
	ThumbnailMaxSize image.Point
	// ImageMagickPath imagemagickの実行パス
	ImageMagickPath string
}

type Processor

type Processor interface {
	Thumbnail(src io.ReadSeeker) (image.Image, error)
	Fit(src io.ReadSeeker, width, height int) (image.Image, error)
	FitAnimationGIF(src io.Reader, width, height int) (*bytes.Reader, error)
	WaveformMp3(src io.ReadSeeker, width, height int) (io.Reader, error)
	WaveformWav(src io.ReadSeeker, width, height int) (io.Reader, error)
}

func NewProcessor

func NewProcessor(c Config) Processor

Directories

Path Synopsis
Package mock_imaging is a generated GoMock package.
Package mock_imaging is a generated GoMock package.

Jump to

Keyboard shortcuts

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