type
ImageSize
One named derived image variant and fit policy.
Properties
| Property | Type | Description |
|---|---|---|
Name | string | The stable key used to address the generated variant. |
Width | int | Target width in pixels. |
Height | int | Target height in pixels. |
Fit | string | Resize policy: "cover" or "contain". |
Full signature
type ImageSize struct {
// Name is the stable key used to address the generated variant.
Name string
// Width is the target width in pixels.
Width int
// Height is the target height in pixels.
Height int
// Fit controls resizing: "cover" (the default) fills Width×Height,
// cropping around the focal point. "inside" fits the picture within
// Width×Height at its own shape and never enlarges it, so the size's
// stored width and height can be smaller. "contain" fits it within
// Width×Height and pads the rest of that canvas: transparent in PNG,
// black in JPEG.
Fit string
}