Skip to content

Bring cover art extraction to parity with Apache Tika (TIKA-4801) #2

Description

@dschmidt

Context

This fork adds Pictures() + RawType for cover art. Apache Tika's TIKA-4801 extracts cover art more broadly (more OGG codecs, MP4 auto-detection, multiple pictures). This issue tracks what Tika supports and this library does not yet, so we can close the gaps for parity.

1. Audio container / codec coverage (cover extraction)

Container / codec Tika (TIKA-4801) this library Gap
MP3 ID3v2.3/2.4 (APIC) -
MP3 ID3v2.2 (PIC) ✅ (tag read) see image table (jpeg/png only)
MP4 / M4A (covr) see image table (jpeg/png only)
OGG Vorbis (metadata_block_picture) -
OGG Opus (OpusTags) -
OGG Speex missing (ogg.go only matches the vorbis/opus prefixes)
OGG Theora missing (\x81theora prefix not handled)
FLAC-in-Ogg ✅ (via metadata_block_picture) missing (only native fLaC is recognized)
FLAC native (PICTURE block) -

2. Embedded image content-type resolution

Case Tika this library Gap
APIC v2.3/2.4 (declared MIME) declared declared, passed through - (parity)
Vorbis / Opus / FLAC (declared MIME) declared declared, passed through - (parity)
MP4 covr auto-detection from bytes type code 13=jpeg / 14=png only (+ png magic sniff) BMP/GIF/etc → empty MIME
ID3v2.2 PIC format code mapped jpeg/png only other formats → empty MIME
Declared MIME missing / wrong byte detection kicks in trusts declared, no fallback no sniff fallback

3. Other capabilities

Capability Tika this library Gap
Multiple pictures per file ✅ (one embedded doc per cover) ID3 ✅, native FLAC ✅ (via ps), OGG/Opus/Vorbis ❌ vorbis-comment map collapses to a single picture
Real image dimensions (W/H) ✅ (via image parsers) ❌ (Picture has no W/H; FLAC/Vorbis block dimensions are discarded) no dimensions field
Picture type (front/back) ✅ (dc:description) ✅ (Type + RawType) -

Suggested priority

  • High (real-world value): MP4 byte-detection and the general sniff fallback. Closes the most practically relevant gap, where the library currently returns an empty MIME for type-coded or mis-declared images.
  • Medium: OGG multiple pictures, FLAC-in-Ogg.
  • Low / exotic: Speex/Theora covers, ID3v2.2 non-jpeg/png, dimensions.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions