summaryrefslogtreecommitdiffstats
path: root/resources/images/image_resource.go
diff options
context:
space:
mode:
Diffstat (limited to 'resources/images/image_resource.go')
-rw-r--r--resources/images/image_resource.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/resources/images/image_resource.go b/resources/images/image_resource.go
index 4e66b010c..846959006 100644
--- a/resources/images/image_resource.go
+++ b/resources/images/image_resource.go
@@ -29,6 +29,7 @@ type ImageResource interface {
type ImageResourceOps interface {
// Height returns the height of the Image.
Height() int
+
// Width returns the width of the Image.
Width() int
@@ -37,8 +38,17 @@ type ImageResourceOps interface {
// Use the anchor option to change the crop box anchor point.
// {{ $image := $image.Crop "600x400" }}
Crop(spec string) (ImageResource, error)
+
+ // Fill scales the image to the smallest possible size that will cover the specified dimensions in spec,
+ // crops the resized image to the specified dimensions using the given anchor point.
+ // The spec is space delimited, e.g. `200x300 TopLeft`.
Fill(spec string) (ImageResource, error)
+
+ // Fit scales down the image using the given spec.
Fit(spec string) (ImageResource, error)
+
+ // Resize resizes the image to the given spec. If one of width or height is 0, the image aspect
+ // ratio is preserved.
Resize(spec string) (ImageResource, error)
// Filter applies one or more filters to an Image.