Skip to content

M4A (MP4): No pictures are found (0.25.0 regression) #698

Closed

Description

@Userwithaname

Reproducer

The following code (based on examples/tag_reader.rs) shows that no pictures are found when given a path to an M4A file:

use lofty::prelude::*;
use lofty::probe::Probe;

use std::path::Path;

fn main() {
    let path_str = std::env::args().nth(1).expect("ERROR: No path specified!");
    let path = Path::new(&path_str);

    assert!(path.is_file(), "ERROR: Path is not a file!");

    let tagged_file = Probe::open(path)
        .expect("ERROR: Bad path provided!")
        .read()
        .expect("ERROR: Failed to read file!");

    let tag = match tagged_file.primary_tag() {
        Some(primary_tag) => primary_tag,
        None => tagged_file.first_tag().expect("ERROR: No tags found!"),
    };

    dbg!(tag.picture_count());
    dbg!(tag.pictures().len());
}

The above code prints the following:

[src/main.rs:22:5] tag.picture_count() = 0
[src/main.rs:23:5] tag.pictures().len() = 0

However, after dropping the version to 0.24.0 in Cargo.toml, running it again prints the following:

[src/main.rs:22:5] tag.picture_count() = 1
[src/main.rs:23:5] tag.pictures().len() = 1

Summary

Lofty no longer finds pictures in M4A files as of version 0.25.0 (also reproducible using the latest commit)

Expected behavior

Lofty should be able to find the picture tags, as it could in prior versions

Assets

I've attached an example file (containing one second of silence and a low resolution version of the Lofty logo assigned as a picture tag) which can be used to reproduce this issue. (It is an M4A file appended with .mp4, because GitHub does not accept M4A).

example.m4a.mp4

Activity

  1. added
    bug
    on Aug 13, 2026
  2. added this to the 0.25.1 milestone on Aug 14, 2026
  3. Serial-ATA commented on Aug 15, 2026

    @Serial-ATA
    Owner

    Good catch, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions