blob: 8275725fc770c8d32c6c5a24e3a09280ef5d6405 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# jpeg-decoder
[](https://github.com/image-rs/jpeg-decoder/actions)
[](https://ci.appveyor.com/project/kaksmet/jpeg-decoder/branch/master)
[](https://crates.io/crates/jpeg-decoder)
A Rust library for decoding JPEGs.
[Documentation](https://docs.rs/jpeg-decoder)
## Example
Cargo.toml:
```toml
[dependencies]
jpeg-decoder = "0.2"
```
main.rs:
```rust
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.48. Minimum Supported Rust Version:
- All releases `0.1.*` compile with rust >= 1.36.
- The releases `0.2.*` may bump Rust Version requirements (TBD).
|