imageio

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StoreEncodedImage

func StoreEncodedImage(ctx context.Context, encoded *EncodedImage, opts StoreOptions) (string, error)

StoreEncodedImage writes an already resized/encoded image to DestURL (or a temp file when empty). It returns the destination URL.

Types

type EncodedImage

type EncodedImage struct {
	Bytes    []byte
	MimeType string
	Width    int
	Height   int
}

func EncodeToFit

func EncodeToFit(raw []byte, options Options) (*EncodedImage, error)

type Options

type Options struct {
	MaxWidth  int
	MaxHeight int
	MaxBytes  int
	Format    string // "", "png", "jpeg"
}

func NormalizeOptions

func NormalizeOptions(input Options) Options

type StoreOptions

type StoreOptions struct {
	// DestURL is an AFS URL (typically file://...). When empty, a file:// URL
	// under the system temp directory is generated.
	DestURL string
}

Jump to

Keyboard shortcuts

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