|
|
|
@ -35,12 +35,13 @@ func (i *Image) Enlarge(width, height int) ([]byte, error) {
|
|
|
|
return i.Process(options)
|
|
|
|
return i.Process(options)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Crop an image by width and height
|
|
|
|
// Crop the image to the exact size specified
|
|
|
|
func (i *Image) Crop(width, height int) ([]byte, error) {
|
|
|
|
func (i *Image) Crop(width, height int, gravity Gravity) ([]byte, error) {
|
|
|
|
options := Options{
|
|
|
|
options := Options{
|
|
|
|
Width: width,
|
|
|
|
Width: width,
|
|
|
|
Height: height,
|
|
|
|
Height: height,
|
|
|
|
Crop: true,
|
|
|
|
Gravity: gravity,
|
|
|
|
|
|
|
|
Crop: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return i.Process(options)
|
|
|
|
return i.Process(options)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|