|
|
|
@ -44,10 +44,10 @@ func (i *Image) ResizeAndCrop(width, height int) ([]byte, error) {
|
|
|
|
// SmartCrop produces a thumbnail aiming at focus on the interesting part.
|
|
|
|
// SmartCrop produces a thumbnail aiming at focus on the interesting part.
|
|
|
|
func (i *Image) SmartCrop(width, height int) ([]byte, error) {
|
|
|
|
func (i *Image) SmartCrop(width, height int) ([]byte, error) {
|
|
|
|
options := Options{
|
|
|
|
options := Options{
|
|
|
|
Width: width,
|
|
|
|
Width: width,
|
|
|
|
Height: height,
|
|
|
|
Height: height,
|
|
|
|
Crop: true,
|
|
|
|
Crop: true,
|
|
|
|
SmartCrop: true,
|
|
|
|
Gravity: GravitySmart,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return i.Process(options)
|
|
|
|
return i.Process(options)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|