Versions in this module Expand all Collapse all v3 v3.1.0 Jun 11, 2019 v3.0.0 Jun 10, 2019 Changes in this version + var ErrImageFormatNotFound = fmt.Errorf("Image format not found") + var ErrInvalidFileType = errors.New("Invalid image type. Supported image formats are JPG and PNG") + type CropAnchorMode string + var CropAnchorModeCentered CropAnchorMode = "centered" + var CropAnchorModeTopLeft CropAnchorMode = "top-left" + type CropOptions struct + Anchor image.Point + AnchorMode CropAnchorMode + Height int + UseRatio bool + Width int + func NewCropOptions() *CropOptions + type IImageCropper interface + Crop func(imageBytes []byte, cropOptions *CropOptions) (*bytes.Buffer, error) + type IResizer interface + ResizeImage func(source io.ReadSeeker, contentType string, imageSize ImageSize) (*bytes.Buffer, error) + type ImageCropper struct + func (ic *ImageCropper) Crop(imageBytes []byte, cropOptions *CropOptions) (*bytes.Buffer, error) + type ImageSize string + const DEFAULT + const LARGE + const MEDIUM + const SMALL + const THUMBNAIL + func (is ImageSize) String() string + type MockResizer struct + ResizeImageFunc func(source io.ReadSeeker, contentType string, imageSize ImageSize) (*bytes.Buffer, error) + func (m *MockResizer) ResizeImage(source io.ReadSeeker, contentType string, imageSize ImageSize) (*bytes.Buffer, error) + type Resizer struct + func (r *Resizer) ResizeImage(source io.ReadSeeker, contentType string, imageSize ImageSize) (*bytes.Buffer, error) Other modules containing this package github.com/app-nerds/kit/v4 github.com/app-nerds/kit/v5 github.com/app-nerds/kit/v6