Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "gif"
license = "MIT OR Apache-2.0"
version = "0.13.3"
version = "0.14.0"
description = "GIF de- and encoder"
authors = ["The image-rs Developers"]
readme = "README.md"
Expand All @@ -21,8 +21,8 @@ color_quant = { version = "1.1", optional = true }

[dev-dependencies]
glob = "0.3"
criterion = "0.5.1"
png = "0.17.16"
criterion = "0.7.0"
png = "0.18.0"
rayon = "1.10.0" # for parallel reencoding example

[features]
Expand Down
12 changes: 12 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# v0.14.0

- `EncodingError` and `DecodingError` are now `#[non_exhaustive]`
- Modified several error paths to return a new variant of `EncodingError` instead of boxing them into
an `io::Error`, several return `Result` types are adjusted accordingly.
- The `Decoded` enum no longer communicates data from decoded sub-blocks such as the repetition count.
It now only contains the meta information on framing and extension data. This ensures we are yielding
less often for performance.
- `last_ext` was renamed to `last_extension_sub_block` for clarity.
- The `Decoder` will now collect XMP and ICC metadata subblocks, making them available after decoding.


# v0.13.3

- Fix interpretation of LZW stream when multiple intermediate reset codes are used.
Expand Down
5 changes: 2 additions & 3 deletions benches/decode.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use criterion::{
black_box, measurement::Measurement, BenchmarkGroup, BenchmarkId, Criterion, Throughput,
};
use criterion::{measurement::Measurement, BenchmarkGroup, BenchmarkId, Criterion, Throughput};
use gif::Decoder;
use std::hint::black_box;

fn read_image(image: &[u8]) -> Option<Vec<u8>> {
let decoder = Decoder::new(black_box(image));
Expand Down
6 changes: 3 additions & 3 deletions benches/rgb_frame.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::fs;
use std::{fs, io};

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

let mut reader = {
let input = fs::File::open(&path).unwrap();
let decoder = png::Decoder::new(input);
let decoder = png::Decoder::new(io::BufReader::new(input));
decoder.read_info().unwrap()
};

let mut buf = vec![0; reader.output_buffer_size()];
let mut buf = vec![0; reader.output_buffer_size().unwrap()];
let info = reader.next_frame(&mut buf).unwrap();

let (w, h, size) = {
Expand Down
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloc::borrow::Cow;
use alloc::vec::Vec;

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

/// Disposal method
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
Expand Down
2 changes: 1 addition & 1 deletion src/reader/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ impl LzwReader {

let (status, consumed_in, consumed_out) = match decode_buffer {
OutputBuffer::Slice(buf) => {
let decoded = decoder.decode_bytes(lzw_data, &mut **buf);
let decoded = decoder.decode_bytes(lzw_data, buf);
(decoded.status, decoded.consumed_in, decoded.consumed_out)
}
OutputBuffer::None => {
Expand Down
Loading