$ show mattiasw/ExifReader
ExifReader is a mature, well-maintained JavaScript library for extracting metadata from image files. It supports a wide range of image formats including JPEG, TIFF, PNG, HEIC, AVIF, WebP, GIF, and JPEG XL. The library parses EXIF, IPTC, XMP, ICC profiles, JFIF, MPF, Photoshop, and camera maker notes (Canon, Pentax). It is designed for both browser and Node.js environments, with a modular architecture that allows custom builds via tree-shaking and feature flags to reduce bundle size. The library exposes a promise-based API (`load()` and `loadView()`) and includes advanced features like adaptive partial file loading (`length: 'auto'`), tag filtering, thumbnail extraction, and comprehensive metadata range reporting. Security is a strong focus: bounds checks, value budgeting, and protection against crafted/malformed files are present throughout the parsers.
The LLM identified 3 files worth highlighting for reuse:
Parses the 'iloc' box in ISO Base Media File Format (used by HEIC/AVIF). Implements security bounds on the number of extents and validates sizes to prevent memory exhaustion attacks. This is a self-contained, reusable component for any project needing to extract item locations from BMFF files. It demonstrates non-obvious skill in binary format parsing with security constraints.
A collection of general-purpose utility functions isolated from internal dependencies. Includes `decompress()` with support for custom brotli/deflate and a `maxDecompressedSize` guard, prototype-safe `objectAssign` and `setProperty`, platform-agnostic string extraction from DataView, a `pushMetadataBlock` pattern for emitting byte-range metadata, and browser/Node detection helpers. These functions could be extracted into a separate project for any application dealing with binary data and decompression.
Implements configurable tag filtering based on metadata groups and individual tag names or IDs. Works with `includeTags` and `excludeTags` options to selectively retain or remove metadata fields. The logic is self-contained (depends only on `tag-filter-config.js` for parsing configuration) and could be reused in any metadata extraction pipeline that needs flexible field selection. Demonstrates a clean separation of configuration from application logic.