heic

package module
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 18 Imported by: 6

README

heic

Status Go Reference

Go decoder for HEIC Image File Format (HEVC in HEIF).

Based on libheif and libde265 compiled to WASM and used with wazero runtime (CGo-free).

The library will first try to use a dynamic/shared library (if installed) via purego and will fall back to WASM.

Build tags

  • nodynamic - do not use dynamic/shared library (use only WASM)

Documentation

Overview

Package heic implements an HEIC image decoder based on libheif/libde265 compiled to WASM.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMemRead  = errors.New("heic: mem read failed")
	ErrMemWrite = errors.New("heic: mem write failed")
	ErrDecode   = errors.New("heic: decode failed")
)

Errors .

Functions

func Decode

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

Decode reads a HEIC image from r and returns it as an image.Image.

func DecodeConfig

func DecodeConfig(r io.Reader) (image.Config, error)

DecodeConfig returns the color model and dimensions of a HEIC image without decoding the entire image.

func Dynamic added in v0.2.1

func Dynamic() error

Dynamic returns error (if there was any) during opening dynamic/shared library.

func Init added in v0.4.0

func Init()

Init initializes wazero runtime and compiles the module. This function does nothing if a dynamic/shared library is used and Dynamic() returns nil. There is no need to explicitly call this function, first Decode will initialize the runtime.

Types

This section is empty.

Jump to

Keyboard shortcuts

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