32 releases

0.3.1 Jan 13, 2024
0.3.0 Oct 17, 2022
0.2.6 May 8, 2022
0.2.3 Mar 27, 2022
0.1.2 Mar 8, 2016

#30 in Parser implementations

Download history 291241/week @ 2024-06-14 332641/week @ 2024-06-21 314658/week @ 2024-06-28 299706/week @ 2024-07-05 322684/week @ 2024-07-12 326065/week @ 2024-07-19 318013/week @ 2024-07-26 318596/week @ 2024-08-02 346501/week @ 2024-08-09 294687/week @ 2024-08-16 303156/week @ 2024-08-23 280617/week @ 2024-08-30 284330/week @ 2024-09-06 250987/week @ 2024-09-13 292508/week @ 2024-09-20 260387/week @ 2024-09-27

1,142,222 downloads per month
Used in 2,413 crates (33 directly)

MIT/Apache

745KB
4K SLoC

WARNING: This crate is in maintenance mode as image-rs seeks to move over to the zune-jpeg crate. However, since other Rust JPEG crates do not support lossless mode, we will continue to welcome PRs related to that functionality.


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.

Dependencies