image

package
v0.0.0-...-31ad618 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Unlicense Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDimensions

func GetDimensions(file io.Reader) (int, int, error)

func Resize

func Resize(input io.ReadSeeker, format Format) (io.ReadSeekCloser, error)

func ShrinkKeepAspect

func ShrinkKeepAspect(width, height uint) []string

func ThumbnailerInstalled

func ThumbnailerInstalled()

Types

type ErrNoThumbnailer

type ErrNoThumbnailer string

func (ErrNoThumbnailer) Error

func (e ErrNoThumbnailer) Error() string

type FFmpeg

type FFmpeg struct {
	Accept map[string]struct{}
}

func FFmpegThumbnailer

func FFmpegThumbnailer() FFmpeg

func (FFmpeg) Accepts

func (ffm FFmpeg) Accepts(mime string) bool

func (FFmpeg) Resize

func (ffm FFmpeg) Resize(input io.ReadSeeker, format Format) (io.ReadSeekCloser, error)

type Format

type Format struct {
	Width, Height uint
	Mime          string
	Quality       int
	ResizeFunc    ResizeFunc
}

type ImageMagick

type ImageMagick struct {
	Accept map[string]struct{}
}

func ImageMagickThumbnailer

func ImageMagickThumbnailer() ImageMagick

func (ImageMagick) Accepts

func (i ImageMagick) Accepts(mime string) bool

func (ImageMagick) Resize

func (i ImageMagick) Resize(input io.ReadSeeker, format Format) (io.ReadSeekCloser, error)

type ResizeFunc

type ResizeFunc func(width, height uint) []string

type Thumbnailer

type Thumbnailer interface {
	Accepts(string) bool
	Resize(io.ReadSeeker, Format) (io.ReadSeekCloser, error)
}

Jump to

Keyboard shortcuts

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