Versions in this module Expand all Collapse all v2 v2.17.2 Sep 3, 2021 Changes in this version + var ErrUnsupportedFormat = errors.New("unsupported image format") + type Format int + const FormatBmp + const FormatGif + const FormatJpeg + const FormatPng + const FormatTiff + func ParseFormat(name string) (Format, error) + func (x *Format) Scan(value interface{}) error + func (x *Format) UnmarshalText(text []byte) error + func (x Format) MarshalText() ([]byte, error) + func (x Format) String() string + func (x Format) Value() (driver.Value, error) + type Option func(*resizeConfig) + func WithFormat(format Format) Option + func WithMode(mode ResizeMode) Option + func WithQuality(quality Quality) Option + type Quality int + const QualityHigh + const QualityLow + const QualityMedium + func ParseQuality(name string) (Quality, error) + func (x *Quality) Scan(value interface{}) error + func (x *Quality) UnmarshalText(text []byte) error + func (x Quality) MarshalText() ([]byte, error) + func (x Quality) String() string + func (x Quality) Value() (driver.Value, error) + type ResizeMode int + const ResizeModeFill + const ResizeModeFit + func ParseResizeMode(name string) (ResizeMode, error) + func (x *ResizeMode) Scan(value interface{}) error + func (x *ResizeMode) UnmarshalText(text []byte) error + func (x ResizeMode) MarshalText() ([]byte, error) + func (x ResizeMode) String() string + func (x ResizeMode) Value() (driver.Value, error) + type Service struct + func New(workers int) *Service + func (s *Service) FormatFromExtension(ext string) (Format, error) + func (s *Service) Resize(ctx context.Context, in io.Reader, width, height int, out io.Writer, ...) error