How sharp reads AVIF metadata
This repository demonstrates how the Sharp image processing library handles AVIF file metadata.
When reading AVIF files, Sharp reports the format as 'heif' (not 'avif') because AVIF is based on the HEIF container format. The actual codec can be identified through the compression field, which will be 'av1' for AVIF files.
npm installnpm testThe test:
- Reads a PNG image (
test-image.png) - Converts it to AVIF format
- Reads the AVIF metadata
- Verifies that
formatis'heif'andcompressionis'av1'