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

Versions [RSS] 0.1.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-09-09T10:14:32Z
Category Codec, Bindings
Source repo head: git clone https://codeberg.org/fusion5/libheif-hs
Distributions
Downloads 3 total (3 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-09-09 [all 2 reports]

Readme for libheif-hs-0.1.0.0

[back to package description]

libheif-hs

A minimal Haskell library that decodes .HEIC files via libheif C bindings.

This package is a standard Cabal project designed to integrate seamlessly with Nix flakes. It currently 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

Since some project dependencies (hs-bindgen-runtime) are not yet published to hackage, you must add them them from cabal.project in this repository into your local cabal.project file.

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

  • kvazaar-2.3.2 (to encode HEIF)
  • libde265-1.1.1 (to decode HEIF)
  • libheif-1.23.1

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 format support. Future versions might expose additional encode/decode formats supported by libheif such as AVIF, VVC, JPEG, etc.