codec

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flags

func Flags(flags []cli.Flag) []cli.Flag

func Register

func Register(c Codec)

Types

type Codec

type Codec interface {
	String() string

	Flags([]cli.Flag) []cli.Flag
	Extensions() []string

	CanEncode() bool

	Sniff(io.ReaderAt) (int, []byte, error)
	Decode(io.Reader) (image.Image, error)
	Encode(io.Writer, image.Image, opts.Common) error
}

func All

func All() []Codec

func Detect

func Detect(output, override string) (Codec, string, error)

func FindCodec added in v0.3.2

func FindCodec(ext string, requireEncode bool) (Codec, error)

func Get

func Get(name string) (Codec, bool)

type Sniffed

type Sniffed struct {
	Header     []byte
	Confidence int
	Codec      Codec
}

func Sniff

func Sniff(reader io.Reader, input string, ignoreExtension bool) (*Sniffed, io.Reader, error)

func (*Sniffed) String

func (s *Sniffed) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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