diff options
author | John Elliott <johnsvenn@googlemail.com> | 2022-02-22 16:50:23 +0000 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-02-23 10:01:50 +0100 |
commit | 7732da9f93503c1a723d6ac5bb77da206cb0fa0e (patch) | |
tree | a205fe894c5413a7dcaa6c6ad8ce64c93e61f874 /docs/layouts | |
parent | aebde49b884c3b5ef73d8e1a01fca8a1354ac5b9 (diff) |
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
Diffstat (limited to 'docs/layouts')
-rw-r--r-- | docs/layouts/shortcodes/imgproc.html | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/layouts/shortcodes/imgproc.html b/docs/layouts/shortcodes/imgproc.html index 5e02317c6..181e97f1d 100644 --- a/docs/layouts/shortcodes/imgproc.html +++ b/docs/layouts/shortcodes/imgproc.html @@ -7,8 +7,10 @@ {{ .Scratch.Set "image" ($original.Resize $options) }} {{ else if eq $command "Fill"}} {{ .Scratch.Set "image" ($original.Fill $options) }} +{{ else if eq $command "Crop"}} +{{ .Scratch.Set "image" ($original.Crop $options) }} {{ else }} -{{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize."}} +{{ errorf "Invalid image processing command: Must be one of Crop, Fit, Fill or Resize."}} {{ end }} {{ $image := .Scratch.Get "image" }} <figure style="padding: 0.25rem; margin: 2rem 0; background-color: #cccc"> |