Expand description
Format-aware image opening.
Wraps image::open so:
- HEIC/HEIF (every modern iPhone photo) decodes through libheif
when the
heicCargo feature is enabled, fails clearly otherwise. - RAW (NEF / CR2 / ARW / DNG / ORF / RW2 / PEF / RWL / SRW via the
TIFF walker; CR3 and RAF via their own containers) decodes via the
camera’s embedded full-res JPEG preview when the
rawfeature is on (default). - Everything else falls through to the
imagecrate.
Call this from any code path that previously did image::open(...)
— thumbnail generation, face detection, brightness sampling.
Functions§
- catch_
decode - Run a decoder, turning a panic inside it into an ordinary error.
- is_
raw_ extension - Recognises every TIFF-based RAW we route through the embedded-JPEG
path. Kept in sync with
scanner::SUPPORTED_EXTENSIONSandreindexer’s extension allowlist — adding a new RAW extension means touching this list too. - needs_
display_ rendition - Formats that need conversion before display in the system WebView.
- open_
image - Open and decode an image. Returns a fully-decoded
DynamicImageregardless of the on-disk format. HEIC/HEIF route through libheif when compiled in; RAW files route throughraw_previewto extract the embedded full-res JPEG preview (the camera’s intended rendering, much better than software-debayered output without proprietary colour profiles); everything else uses theimagecrate’s native decoders. - raw_
preview_ jpeg - Bytes of the embedded JPEG preview for any supported RAW: CR3 and RAF have their own containers, everything else is TIFF-based.