Skip to content

Commit 706fcb3

Browse files
authored
Merge pull request #222 from image-rs/release-0.14.0
Release 0.14.0
2 parents 94c8f9b + c6c0e74 commit 706fcb3

File tree

6 files changed

+22
-11
lines changed

6 files changed

+22
-11
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "gif"
33
license = "MIT OR Apache-2.0"
4-
version = "0.13.3"
4+
version = "0.14.0"
55
description = "GIF de- and encoder"
66
authors = ["The image-rs Developers"]
77
readme = "README.md"
@@ -21,8 +21,8 @@ color_quant = { version = "1.1", optional = true }
2121

2222
[dev-dependencies]
2323
glob = "0.3"
24-
criterion = "0.5.1"
25-
png = "0.17.16"
24+
criterion = "0.7.0"
25+
png = "0.18.0"
2626
rayon = "1.10.0" # for parallel reencoding example
2727

2828
[features]

Changes.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# v0.14.0
2+
3+
- `EncodingError` and `DecodingError` are now `#[non_exhaustive]`
4+
- Modified several error paths to return a new variant of `EncodingError` instead of boxing them into
5+
an `io::Error`, several return `Result` types are adjusted accordingly.
6+
- The `Decoded` enum no longer communicates data from decoded sub-blocks such as the repetition count.
7+
It now only contains the meta information on framing and extension data. This ensures we are yielding
8+
less often for performance.
9+
- `last_ext` was renamed to `last_extension_sub_block` for clarity.
10+
- The `Decoder` will now collect XMP and ICC metadata subblocks, making them available after decoding.
11+
12+
113
# v0.13.3
214

315
- Fix interpretation of LZW stream when multiple intermediate reset codes are used.

benches/decode.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use criterion::{
2-
black_box, measurement::Measurement, BenchmarkGroup, BenchmarkId, Criterion, Throughput,
3-
};
1+
use criterion::{measurement::Measurement, BenchmarkGroup, BenchmarkId, Criterion, Throughput};
42
use gif::Decoder;
3+
use std::hint::black_box;
54

65
fn read_image(image: &[u8]) -> Option<Vec<u8>> {
76
let decoder = Decoder::new(black_box(image));

benches/rgb_frame.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::fs;
1+
use std::{fs, io};
22

33
use criterion::{Criterion, Throughput};
44
use gif::{Encoder, Frame, Repeat};
@@ -19,11 +19,11 @@ fn main() {
1919

2020
let mut reader = {
2121
let input = fs::File::open(&path).unwrap();
22-
let decoder = png::Decoder::new(input);
22+
let decoder = png::Decoder::new(io::BufReader::new(input));
2323
decoder.read_info().unwrap()
2424
};
2525

26-
let mut buf = vec![0; reader.output_buffer_size()];
26+
let mut buf = vec![0; reader.output_buffer_size().unwrap()];
2727
let info = reader.next_frame(&mut buf).unwrap();
2828

2929
let (w, h, size) = {

src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use alloc::borrow::Cow;
22
use alloc::vec::Vec;
33

44
#[cfg(feature = "color_quant")]
5-
use std::collections::{BTreeMap, BTreeSet};
5+
use alloc::collections::{BTreeMap, BTreeSet};
66

77
/// Disposal method
88
#[derive(Debug, Copy, Clone, PartialEq, Eq)]

src/reader/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ impl LzwReader {
329329

330330
let (status, consumed_in, consumed_out) = match decode_buffer {
331331
OutputBuffer::Slice(buf) => {
332-
let decoded = decoder.decode_bytes(lzw_data, &mut **buf);
332+
let decoded = decoder.decode_bytes(lzw_data, buf);
333333
(decoded.status, decoded.consumed_in, decoded.consumed_out)
334334
}
335335
OutputBuffer::None => {

0 commit comments

Comments
 (0)