Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidParam = fmt.Errorf("invalid parameter") ErrImageIsNil = fmt.Errorf("image is nil") ErrImageFormatUnknown = fmt.Errorf("image format is unknown") ErrImageFormatNotSupported = fmt.Errorf("image format is not supported") ErrFailedToDecodeJPEG = fmt.Errorf("failed to decode as jpeg") ErrFailedToDecodePNG = fmt.Errorf("failed to decode as png") ErrFailedToDecodeWebP = fmt.Errorf("failed to decode as webp") ErrFailedToDecodeAVIF = fmt.Errorf("failed to decode as avif") ErrFailedToEncodeWebP = fmt.Errorf("failed to encode as webp") ErrFailedToEncodeAVIF = fmt.Errorf("failed to encode as avif") )
View Source
var (
ErrEncoderReturnedUnknownError = errors.New("error occurred while encoding WebP")
)
Functions ¶
func ProcessStaticImage ¶
func ProcessStaticImage(data *[]byte, targetImage *TargetImage) (*[]byte, error)
Types ¶
type ImageFormat ¶
type ImageFormat int
const ( ImageFormatUnknown ImageFormat = iota ImageFormatJPEG ImageFormatPNG ImageFormatAnimatedPNG ImageFormatWebP ImageFormatAnimatedWebP ImageFormatGIF ImageFormatAVIF ImageFormatAnimatedAVIF ImageFormatICO )
type TargetFormat ¶
type TargetFormat int
const ( TargetFormatWebP TargetFormat = iota TargetFormatAVIF )
type TargetImage ¶
type TargetImage struct { MaxWidth int MaxHeight int Quality int Format TargetFormat }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.