libheif-hs: Haskell FFI bindings to libheif

[ bindings, codec, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

Decodes media in the HEIF format exposing a subset of available operations and data from the underyling C libheif library.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0
Change log CHANGELOG.md
Dependencies base (>=4.7 && <5), bytestring (>=0.11 && <0.13), c-expr-runtime (>=0.1 && <0.2), containers (>=0.5 && <1), hs-bindgen-runtime (>=0.1 && <0.2) [details]
License MIT
Author
Maintainer Dragos Ionita
Uploaded by fusion5 at 2026-10-12T14:09:39Z
Category Codec, Bindings
Source repo head: git clone https://codeberg.org/fusion5/libheif-hs
Distributions
Downloads 17 total (14 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
All reported builds failed as of 2026-10-12 [all 2 reports]

Readme for libheif-hs-0.2.0.0

[back to package description]

libheif-hs

A minimal Haskell codec for .HEIC files via libheif C bindings.

This package is a standard Cabal project designed to integrate seamlessly with Nix flakes. It exposes a core subset of the HEIF format's available data, with built-in support for WebAssembly (wasm32-wasi) cross-compilation.

Usage

The flake outputs provide the following packages for each supported system:

  • packages.default: The natively compiled Cabal package.
  • packages.wasm: The WebAssembly cross-compiled Cabal package.

Note: If you are not using Nix, this functions as a standard Cabal package (see below).

How to use the Cabal package without a flake shell

You'll also need the following libraries present in pkg-config compiled with at least the flags seen the flake:

  • libheif-1.23.1
  • kvazaar-2.3.2 or newer (to encode HEIF)
  • libde265-1.1.1 or newer (to decode HEIF)
  • libaom-3.12.1 or newer (to encode and decode AV1)

Development

The repository provides two distinct Nix development shells depending on your target environment.

Native Development

For standard system development (includes tooling support like Haskell Language Server):

nix develop .#default
cabal test libheif-hs-test

WebAssembly Development

For wasm32-wasi cross-compilation testing:

nix develop .#wasm
wasm-test libheif-hs-test

Nix flake checking

For testing that both output packages build correctly:

nix flake check

Future work

  • Expanded API: expose more features of the underlying libheif interface.
  • Broader codec support: the dependent libheif is currently compiled only with HEIF and AV1 format support. Future versions might expose additional encode/decode formats supported by libheif such as VVC, JPEG, etc.