heic

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 17 Imported by: 11

README

heic

Status Go Reference

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

Based on the Rust heic decoder compiled to WASM and transpiled to Go with wasm2go (CGo-free).

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

Build tags

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

Documentation

Overview

Package heic implements an HEIC image decoder based on the pure-Rust heic crate compiled to WASM (run via wazero, or transpiled with the wasm2go build tag), or libheif/libde265 via a dynamic library.

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 .

View Source
var ForceWasmMode bool

ForceWasmMode, if true, forces using the WASM-based decoder even if a dynamic/shared library is available.

This exists mainly for testing purposes.

It is not safe to change this concurrently with any other use of this package.

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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