mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
Allow images to be cropped without being resized
Introduces the Crop method for image processing which implements gift.CropToSize. Also allows a smartCrop without resizing, and updates the documentation. Fixes #9499
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
aebde49b88
commit
7732da9f93
@@ -176,6 +176,10 @@ func (r *resourceAdapter) Data() interface{} {
|
||||
return r.target.Data()
|
||||
}
|
||||
|
||||
func (r *resourceAdapter) Crop(spec string) (resource.Image, error) {
|
||||
return r.getImageOps().Crop(spec)
|
||||
}
|
||||
|
||||
func (r *resourceAdapter) Fill(spec string) (resource.Image, error) {
|
||||
return r.getImageOps().Fill(spec)
|
||||
}
|
||||
|
Reference in New Issue
Block a user