Documentation
¶
Overview ¶
Package thumbnail provides bounded standard-library image decoding and sampling
Index ¶
- Constants
- func DataURI(ctx context.Context, source image.Image) (string, error)
- func Decode(ctx context.Context, data []byte, width, height int, options ...Limits) (image.Image, error)
- func Fit(width, height, maxWidth, maxHeight int, options ...Limits) (int, int, error)
- func FitDecode(ctx context.Context, data []byte, maxWidth, maxHeight int, options ...Limits) (image.Image, error)
- func PNG(ctx context.Context, source image.Image) ([]byte, error)
- type Limits
- type Rendered
Constants ¶
const MaxDimension = 320
const MaxInputBytes = 64 << 20
const MaxSourcePixels = 32_000_000
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
func Decode(ctx context.Context, data []byte, width, height int, options ...Limits) (image.Image, error)
Decode retains a bounded full source image while producing an RGBA thumbnail Cancellation is cooperative at reads, sample rows, and result publication
Types ¶
type Limits ¶
Limits bounds encoded input and decoded dimensions for one call Start with DefaultLimits when overriding a single field. Larger limits can increase codec memory use; limits must be positive safe integers
func DefaultLimits ¶
func DefaultLimits() Limits
Return the default encoded-byte and source-pixel limits