A Rust crate that allows you to read and write cbz, cbt, cb7 files, with ComicInfo.xml metadata.
cbz: support forcbzreader and writercbt: support forcbtreader and writercb7: support forcb7reader and writerlog: logging...comicinfo: support forComicInfo.xmlmetadata
None of these features is enabled by default.
use cbz::read::{cbz::CbzReader, ComicBookReader};
fn main() {
let mut cbz = CbzReader::from_path("fufuu-ijou-en-70.cbz").unwrap();
/// get images names
let pages = cbz.pages();
for page in page {
let file = cbz.get_page_by_path(&page).unwrap();
/// DO whatever you want with it....
}
}use cbz::write::{cbz::CbzWriter, ComicBookWriter, ComicBookWriterExt};
use std::{io::{BufWriter}, fs::File};
fn main() {
let mut my_file = CbzWriter::new(BufWriter::new(File::create("new.cbz")?));
my_file.add_page_from_path("first.jpg")?;
my_file.add_page_from_path("second.jpg")?;
let _ = my_file.finish()?;
}You can make your own reader via the cbz::read::ComicBookReader trait. For writer, check the cbz::read::ComicBookWriter trait.
- cbz pip created by @hyugogirubato
- anansi-project/comicinfo for the
ComicInfo.xmlspecification
MIT or Apache 2.0 (at your choice)