decode

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package decode wraps image.Decode and registers extra formats (WebP, JXL) so the caller can hand off any supported file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(path string) (image.Image, string, error)

File opens path and decodes it as an image. JXL is handled via a djxl subprocess fallback (returns a clear error if djxl is missing).

func Reader

func Reader(r io.Reader) (image.Image, string, error)

Reader decodes from a reader using the registered decoders. Returns the decoded image and the detected format ("png", "jpeg", "gif", "webp").

Types

type AnimatedGIF

type AnimatedGIF struct {
	Frames    []*image.RGBA // composed, one per source frame
	DelaysCS  []int         // per-frame delay in centiseconds
	LoopCount int           // gif.GIF.LoopCount (0 = forever)
}

AnimatedGIF holds the result of decoding every frame of an animated GIF with disposal methods applied, so each frame is the full composed image you'd see at that moment.

func AllFramesGIF

func AllFramesGIF(path string) (*AnimatedGIF, error)

AllFramesGIF decodes every frame of an animated GIF, composing disposal methods. Use this when you want to process each visible frame, not just the raw delta layers stdlib returns.

Jump to

Keyboard shortcuts

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