Documentation ¶
Index ¶
- Constants
- type Imager
- func (i *Imager) Bytes() ([]byte, error)
- func (i *Imager) Crop(width, height int, x, y int) *Imager
- func (i *Imager) LoadByte(data []byte) error
- func (i *Imager) LoadFile(location string) error
- func (i *Imager) Resize(width, height int, modes ...ResizeMode) *Imager
- func (i *Imager) Rotate(degrees int) *Imager
- func (i *Imager) Save(location string) error
- type ResizeMode
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Imager ¶
Imager is a struct that can be used to manipulate an image
func NewImagerFromBytes ¶
NewImagerFromBytes creates a new Imager from bytes i.e : imgr, err := imager.NewImagerFromBytes(data)
func NewImagerFromFile ¶
NewImagerFromFile creates a new Imager from a file i.e : imgr, err := imager.NewImagerFromFile("image.jpg")
type ResizeMode ¶
type ResizeMode int
ResizeMode is a flag that can be used to resize an image
const ( // MD_FIT - Fit the image within the specified dimensions, maintaining the aspect ratio MD_FIT ResizeMode = iota // MD_CROP - Crop the image to the center MD_CROP // MD_SCALE - Resize keeping the aspect ratio MD_SCALE // MD_STRETCH - Resize to exact dimensions without keeping the aspect ratio MD_STRETCH )
Click to show internal directories.
Click to hide internal directories.