diff --git a/CHANGELOG.md b/CHANGELOG.md index e2f54380..ed62a447 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **ID3v2**: `LanguageFrame`'s `lang` field has changed type - `String` -> `[u8; 3]` - **MP3**: Renamed `MP3File` -> `MPEGFile` - **MP4**: `Atom::data` will now return all values +- **Vorbis Comments**: Recognize lowercase `METADATA_BLOCK_PICTURE` as a picture ## [0.7.3] - 2022-07-22 diff --git a/src/ogg/read.rs b/src/ogg/read.rs index 615ce334..612a973d 100644 --- a/src/ogg/read.rs +++ b/src/ogg/read.rs @@ -87,7 +87,7 @@ where // Make sure there was a separator present, otherwise just move on if let Some(value) = comment_split.next() { match key { - "METADATA_BLOCK_PICTURE" => tag + k if k.eq_ignore_ascii_case("METADATA_BLOCK_PICTURE") => tag .pictures .push(Picture::from_flac_bytes(value.as_bytes(), true)?), // The valid range is 0x20..=0x7D not including 0x3D diff --git a/src/ogg/tag.rs b/src/ogg/tag.rs index ccf8cfac..3117b4ca 100644 --- a/src/ogg/tag.rs +++ b/src/ogg/tag.rs @@ -623,4 +623,13 @@ mod tests { let tag_bytes = std::fs::read("tests/tags/assets/zero.vorbis").unwrap(); let _ = read_tag(&tag_bytes); } + + #[test] + fn issue_60() { + let tag_bytes = std::fs::read("tests/tags/assets/issue_60.vorbis").unwrap(); + let tag = read_tag(&tag_bytes); + + assert_eq!(tag.pictures().len(), 1); + assert!(tag.items.is_empty()); + } } diff --git a/tests/tags/assets/issue_60.vorbis b/tests/tags/assets/issue_60.vorbis new file mode 100644 index 00000000..86cc0fc9 Binary files /dev/null and b/tests/tags/assets/issue_60.vorbis differ