Thumbnails for opus/ogg

This commit is contained in:
Shrecknt 2024-05-02 21:14:09 -07:00
parent 7279793d25
commit 59739b5d1f
2 changed files with 6 additions and 4 deletions

View file

@ -255,6 +255,7 @@ fn read_vorbis(path: &Path) -> Result<SongTags, Error> {
"COMPOSER" => tags.composer = Some(value),
"GENRE" => tags.genre = Some(value),
"PUBLISHER" => tags.label = Some(value),
"METADATA_BLOCK_PICTURE" => tags.has_artwork = true,
_ => (),
}
}
@ -296,6 +297,7 @@ fn read_opus(path: &Path) -> Result<SongTags, Error> {
"COMPOSER" => tags.composer = Some(value),
"GENRE" => tags.genre = Some(value),
"PUBLISHER" => tags.label = Some(value),
"METADATA_BLOCK_PICTURE" => tags.has_artwork = true,
_ => (),
}
}

View file

@ -206,12 +206,12 @@ fn read_mp4(path: &Path) -> Result<DynamicImage, Error> {
.and_then(|d| image::load_from_memory(d.data).map_err(|e| Error::Image(path.to_owned(), e)))
}
fn read_vorbis(_: &Path) -> Result<DynamicImage, Error> {
Err(Error::UnsupportedFormat("vorbis"))
fn read_vorbis(path: &Path) -> Result<DynamicImage, Error> {
read_flac(path)
}
fn read_opus(_: &Path) -> Result<DynamicImage, Error> {
Err(Error::UnsupportedFormat("opus"))
fn read_opus(path: &Path) -> Result<DynamicImage, Error> {
read_flac(path)
}
#[cfg(test)]