Skip to content

TIKA-4870: Parse AVIF, do not only detect it - #3116

Merged
tballison merged 3 commits into
apache:mainfrom
dschmidt:avif-parser
Sep 2, 2026
Merged

TIKA-4870: Parse AVIF, do not only detect it#3116
tballison merged 3 commits into
apache:mainfrom
dschmidt:avif-parser

Conversation

@dschmidt

@dschmidt dschmidt commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

AVIF reached no parser. HeifParser claims image/heif, image/heif-sequence, image/heic and image/heic-sequence, nothing else in tika-parsers claims image/avif, and its mime entry declares no sub-class-of, so an AVIF was detected and then handed to no one: no dimensions, no EXIF, no XMP. Detection was added in TIKA-3193 back in 2020 and nothing picked it up since.

It is the same ISO-BMFF container and the metadata sits in the same boxes, so adding the type is the whole change. What comes out of the fixture: image/avif, the brands, 32x32 from the ispe, and the XMP that HeifXmp locates through meta/iinf/iloc, the same path HEIC takes.

The fixture is a 32x32 gradient encoded with libavif through ImageMagick, with an XMP packet attached, 1 KB.

Two things this does not touch. Animated AVIF still detects as video/quicktime, which is TIKA-4509 and is a question about the media type name rather than about parsing. And the AVIF motion photo case from TIKA-4869 needs #3115 as well, so its fixture and test follow whichever of the two lands second; I have verified locally that the two together emit the video from the trailing mpvd box as expected.

https://issues.apache.org/jira/browse/TIKA-4870

AVIF reached no parser: HeifParser claimed heif, heif-sequence, heic and
heic-sequence, nothing else claims image/avif, and its mime entry declares
no sub-class-of, so an AVIF was detected and then handed to no one.

It is the same ISO-BMFF container, and the metadata sits in the same boxes:
adding the type is enough for the dimensions, the brands and the XMP that
HeifXmp locates through meta/iinf/iloc. Detection was added in TIKA-3193 and
nothing picked it up since.

The fixture is a 32x32 gradient encoded with libavif through ImageMagick,
with an XMP packet attached.
@THausherr
THausherr requested a lite review from Copilot September 2, 2026 15:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Adds actual parsing support for AVIF by routing image/avif to HeifParser, with a regression test and release note so AVIF metadata (dimensions/XMP, etc.) is extracted instead of only being detected.

Changes:

  • Extend HeifParser supported media types to include image/avif
  • Add a JUnit test verifying AVIF parsing extracts content-type, container brand, dimensions, and XMP fields
  • Document the behavior change in CHANGES.txt

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
.../HeifParserTest.java Adds regression coverage for parsing AVIF (type, dimensions, XMP).
.../HeifParser.java Registers image/avif as a supported type for HeifParser.
CHANGES.txt Notes that AVIF is now parsed (not just detected) under TIKA-4870.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tballison
tballison merged commit e505b4a into apache:main Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants