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

Stream picture tags

Open probablykasper opened this issue 5 months ago • 7 comments

Summary

The ability to read the picture tags as a stream for improve performance

API design

let probe = lofty::Probe::open(path);

let tags_reader = probe.into_reader();

// Consumes tags_reader and returns an iterator that skips non-picture tags
let pictures_iterator = tags_reader.pictures();

let first_picture_reader = pictures_iterator.next()?;

let bytes = picture_reader.data; // std::io::Bytes<> iterator
let mime_type = picture_reader.mime_type; // Access other info about the picture

probablykasper avatar Jan 22 '24 08:01 probablykasper