mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-13 14:12:31 +00:00
Vorbis Comments: Don't rely on the case of METADATA_BLOCK_PICTURE
closes: #60
This commit is contained in:
parent
81a8a616c1
commit
f3a7e4d5f1
4 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
BIN
tests/tags/assets/issue_60.vorbis
Normal file
BIN
tests/tags/assets/issue_60.vorbis
Normal file
Binary file not shown.
Loading…
Reference in a new issue