imageproc

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 6 Imported by: 0

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.

func Default

func Default() Processor

Default returns buckt's built-in processor: pure-Go JPEG and PNG resizing with no cgo and no dependency beyond what buckt already ships. It does not encode WebP — plug in a Processor that does (see the webp module) for that.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL