Documentation
¶
Overview ¶
Package imageproc defines the pluggable image processor buckt uses to build image derivatives (thumbnails, etc.), plus a built-in pure-Go default.
The Processor interface is stdlib-only by design: an alternative processor (e.g. one that also encodes WebP or AVIF) can implement it in its own module WITHOUT importing buckt, keeping the dependency one-way — the same rule the storage backends follow. Register one with buckt.WithImageProcessor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Processor ¶
type Processor interface {
// Resize scales data to at most maxWidth pixels wide (preserving aspect
// ratio and never upscaling) and encodes it in format. An empty format means
// "keep the source format". It returns the encoded bytes and their content
// type, or an error for inputs/formats it does not support.
Resize(data []byte, maxWidth uint, format string) (out []byte, contentType string, err error)
}
Processor resizes and re-encodes images for derivative generation.
Click to show internal directories.
Click to hide internal directories.