Documentation ¶
Overview ¶
avatar/lib is a simple library you can use to make images squared and of fixed size.
Index ¶
Constants ¶
View Source
const (
ErrSize = "Minimun size not reached. Should be at least %vx%v, is %vx%v"
)
Variables ¶
View Source
var (
MinSize int
)
Functions ¶
Types ¶
type ImageValidation ¶
type ImageValidation struct { Condition func(int, int) bool F func(*ProfileImage) (*image.Image, error) Id func() string }
func (*ImageValidation) Validate ¶
func (iv *ImageValidation) Validate(pi *ProfileImage) error
type ProfileImage ¶
type ProfileImage struct { Width, Height int ErrorMsg string // contains filtered or unexported fields }
func MakeProfileImage ¶
func MakeProfileImage(im image.Image, minSize int) (*ProfileImage, error)
func NewProfileImage ¶
func NewProfileImage(im image.Image) *ProfileImage
func (*ProfileImage) NewImage ¶
func (pi *ProfileImage) NewImage(im image.Image)
Click to show internal directories.
Click to hide internal directories.