প্রকল্প সম্পর্কে
heic-rs is a pure-Rust implementation of a HEIC/HEIF image decoder designed to be safe, portable, and free of C dependencies. The project emphasizes a 'no C toolchain' approach, meaning it can be built with standard Rust tools without requiring cmake, pkg-config, or external libraries like libheif. It strictly forbids unsafe code, ensuring that memory safety is guaranteed by the compiler and runtime checks rather than manual memory management.
The core functionality currently focuses on the container half of the HEIC format. This includes parsing ISOBMFF boxes, handling metadata such as EXIF and ICC profiles, and managing image properties like rotation, mirroring, and clean aperture. A significant part of the current capability is grid derivation and tile compositing, which is essential for decoding real-world photos from devices like iPhones and Macs that store large images as grids of smaller tiles. The library also performs YUV to RGB color conversion, supporting various standards (BT.601, BT.709, BT.2020) and chroma upsampling methods.
However, users must be aware of the current status: the HEVC still-picture decoder is not yet linked into the crate. While the `probe()` function works fully to inspect file metadata, the `decode()` function will return an `Error::Unsupported` when it reaches the codec seam. The HEVC decoder is being developed as a separate crate and will be integrated in the future. Until then, this library is suitable for parsing metadata, handling container structures, and preparing the data for pixel decoding once the HEVC module is available.
The project is `no_std` friendly and ready for WebAssembly (wasm32-unknown-unknown), making it a viable option for browser-based image processing or embedded systems where C dependencies are problematic. It is licensed under MIT or Apache-2.0, providing a permissive alternative to other pure-Rust decoders that may use copyleft licenses like AGPL. The design adheres to a strict 'SBIO' rule, where business logic performs no I/O, keeping the core pure and testable. Security features include bounds-checked parsers and configurable resource limits via `max_pixels` to prevent exhaustion attacks.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.