type

ImageSize

One named derived image variant and fit policy.

Properties

PropertyTypeDescription
NamestringThe stable key used to address the generated variant.
WidthintTarget width in pixels.
HeightintTarget height in pixels.
FitstringResize 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 }

Source core/config.go:370