heif

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HEIF

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

HEIF wraps a libheif context and exposes the primary image as an image.Image.

func Open

func Open(path string) (*HEIF, error)

Open opens a HEIF image by path and decodes its primary image.

func Parse

func Parse(buf []byte) (*HEIF, error)

Parse opens a HEIF image from a byte slice and decodes its primary image.

func Read

func Read(r io.Reader) (*HEIF, error)

Read opens a HEIF image from a reader and decodes its primary image.

func (*HEIF) At

func (h *HEIF) At(x, y int) color.Color

At returns the color of the pixel at x, y in the primary image.

func (*HEIF) Bounds

func (h *HEIF) Bounds() image.Rectangle

Bounds returns the bounds of the primary image.

func (*HEIF) Close

func (h *HEIF) Close() error

Close releases the underlying libheif resources.

func (*HEIF) ColorModel

func (h *HEIF) ColorModel() color.Model

ColorModel returns the color model of the primary image.

func (*HEIF) Metadata

func (h *HEIF) Metadata() []media.Metadata

Metadata returns metadata from the primary image.

EXIF and XMP payloads are parsed and expanded into their structured metadata entries. Any remaining blocks are returned as generic HEIF metadata records.

func (*HEIF) Primary

func (h *HEIF) Primary() image.Image

Primary returns the decoded primary image.

func (*HEIF) Thumbnails

func (h *HEIF) Thumbnails() []image.Image

Thumbnails returns any attached thumbnail images for the primary image.

func (*HEIF) XMP

func (h *HEIF) XMP() *xmp.XMP

XMP returns the parsed XMP document from the primary image, if present.

type Meta

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

func (*Meta) Any

func (m *Meta) Any() any

func (*Meta) Bytes

func (m *Meta) Bytes() []byte

func (*Meta) Image

func (m *Meta) Image() image.Image

func (*Meta) Key

func (m *Meta) Key() string

func (*Meta) MarshalJSON

func (m *Meta) MarshalJSON() ([]byte, error)

func (*Meta) Value

func (m *Meta) Value() string

Jump to

Keyboard shortcuts

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