• Stars
    star
    148
  • Rank 249,983 (Top 5 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created almost 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JPEG decoder written in Rust

jpeg-decoder

Rust CI AppVeyor Build Status crates.io

A Rust library for decoding JPEGs.

Documentation

Example

Cargo.toml:

[dependencies]
jpeg-decoder = "0.3"

main.rs:

extern crate jpeg_decoder as jpeg;

use std::fs::File;
use std::io::BufReader;

fn main() {
    let file = File::open("hello_world.jpg").expect("failed to open file");
    let mut decoder = jpeg::Decoder::new(BufReader::new(file));
    let pixels = decoder.decode().expect("failed to decode image");
    let metadata = decoder.info().unwrap();
}

Requirements

This crate compiles with Rust >= 1.61. Minimum supported Rust version:

  • All releases 0.1.* compile with Rust >= 1.36.
  • All releases 0.2.* compile with Rust >= 1.48.