File: webp-dump.rs

package info (click to toggle)
rust-gufo-webp 0.3.0~beta-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 144 kB
  • sloc: makefile: 4
file content (17 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {
    let path = std::env::args()
        .nth(1)
        .expect("First agument must be a path.");
    let data = std::fs::read(path).unwrap();
    let webp = gufo_webp::WebP::new(data).unwrap();

    for chunk in webp.chunks() {
        match chunk.four_cc() {
            gufo_webp::FourCC::Unknown(unknown) => println!(
                "Unknown({})",
                String::from_utf8_lossy(&u32::to_le_bytes(unknown))
            ),
            chunk_type => println!("{chunk_type:?}"),
        }
    }
}