Documentation ¶
Overview ¶
Package scaler provides utilities for scaling images.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCancelled = fmt.Errorf("scale operation on cancelled Scaler")
ErrCancelled is returned when one is trying to interact with an stopped scaler.
Functions ¶
This section is empty.
Types ¶
type Scaler ¶
type Scaler interface { // Scale converts the image (img) to have width toWidth in pixels while // preserving its aspect ratio. Scale(ctx context.Context, img io.Reader, toWidth int) ([]byte, error) // Cancel stops the scaler and of its operations. Users may not use // any further methods on cancelled scalers. Cancel() }
Scaler is a utility type which could be used for scaling images.
Click to show internal directories.
Click to hide internal directories.