lofty-rs icon indicating copy to clipboard operation
lofty-rs copied to clipboard

Add a `Picture` interface to `ApeTag`

Open Serial-ATA opened this issue 2 years ago • 0 comments

Summary

There is no easy way to interact with Pictures when using ApeTag. They are currently treated as any other item with ItemValue::Binary.

We could very easily split them off from the other items and store them separately, like we do for VorbisComments.

API design

impl ApeTag {
    /// Removes PictureType::Icon and PictureType::OtherIcon like Id3v2Tag and VorbisComments
    fn insert_picture(&mut self, picture: Picture) -> Option<Picture>;
    fn pictures(&self) -> impl Iterator<Item = &Picture>;
    fn remove_picture_type(&mut self, picture_type: PictureType) -> impl Iterator<Item = Picture>;
}

Serial-ATA avatar Oct 23 '23 16:10 Serial-ATA