packages feed

libheif-hs-0.2.0.0: README.md

# libheif-hs

A minimal Haskell codec for `.HEIC` files via 
[libheif](https://github.com/strukturag/libheif) C bindings.

This package is a standard Cabal project designed to integrate seamlessly with 
[Nix flakes](https://wiki.nixos.org/wiki/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):

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

**WebAssembly Development**

For wasm32-wasi cross-compilation testing:

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

**Nix flake checking**

For testing that both output packages build correctly:

```bash
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.