image

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package image is the media worker's image producer (libvips, CGO): the Image presets' private WebP files, the Zip presets, the public presets' fixed names, editor views, and the kinds' default public images. A Processor runs one media.ProcessJob: it redoes stale or pending outputs, records them in one manifest edit per pass, and keeps public/ in step.

Index

Constants

View Source
const Recipe = "webp-1"

Recipe versions the image producer: a change re-renders every image output.

Variables

This section is empty.

Functions

func PublishDefaults added in v0.62.0

func PublishDefaults(ctx context.Context, store media.Store, reg *media.Registry) ([]string, error)

PublishDefaults renders every public preset's Default (a file in its kind's Defaults) to the kind's _default item at every width, where the access agent serves a missing public name from. An unchanged default is not written again. It returns the keys written, for a CDN purge. Apps run it from their deploy step.

Types

type Config

type Config struct {
	Store     media.Store
	Manifests *media.Manifests
	// Purge relays overwritten or deleted public keys to the host's
	// Hooks.PurgePublic (media.HostQueue.Purge); optional.
	Purge   func(ctx context.Context, keys []string) error
	Workers int // uploads decoded at once; default 2
	// MaxPixels bounds a decoded source, all frames of an animation
	// together (default 100 MP); MaxFrames and MaxAnimationSeconds bound
	// animations (defaults 1000 and 60).
	MaxPixels           int
	MaxFrames           int
	MaxAnimationSeconds float64
	TempDir             string // zip scratch; default os.TempDir()
}

Config configures a Processor.

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

Processor runs image jobs. It is safe for concurrent use and idempotent: an output whose fingerprint matches is never redone (unless forced).

func New

func New(c Config) (*Processor, error)

func (*Processor) Process

func (p *Processor) Process(ctx context.Context, job media.ProcessJob) error

Process brings ref's image outputs up to date. Passes repeat until the manifest needs no more work, so a commit landing during a pass is absorbed.

Jump to

Keyboard shortcuts

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