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:
John Elliott
2022-02-22 16:50:23 +00:00
committed by Bjørn Erik Pedersen
parent aebde49b88
commit 7732da9f93
9 changed files with 75 additions and 8 deletions

View File

@@ -364,7 +364,7 @@ func (i ImageConfig) GetKey(format Format) string {
k += "_" + i.FilterStr
if strings.EqualFold(i.Action, "fill") {
if strings.EqualFold(i.Action, "fill") || strings.EqualFold(i.Action, "crop") {
k += "_" + anchor
}