Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidExtension ¶
Types ¶
type Config ¶
type Config struct {
Conversion Conversion
JPEG JPEGOptions
PNG PNGOptions
WebP WebPOptions
Resize Resize
}
func DefaultConfig ¶
func DefaultConfig() Config
type Conversion ¶
type ImageProcessor ¶
type ImageProcessor interface {
Config() Config
Optimize(ctx context.Context, r io.Reader) ([]byte, error)
Resize(ctx context.Context, r io.Reader) ([]byte, error)
Convert(ctx context.Context, r io.Reader, toFormat string) ([]byte, error)
}
func New ¶
func New() ImageProcessor
func NewWithConfig ¶
func NewWithConfig(cfg Config) ImageProcessor
type JPEGOptions ¶
type JPEGOptions struct {
Quality int
}
type PNGOptions ¶
type PNGOptions struct {
Compression png.CompressionLevel
Lossless bool
Optimize bool
}
type WebPOptions ¶
Click to show internal directories.
Click to hide internal directories.