Skip to content

Commit

Permalink
Upgrade libimagequant
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jan 4, 2022
1 parent f9e3f63 commit 3a29451
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 51 deletions.
176 changes: 131 additions & 45 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "AGPL-3.0+"
name = "gifski"
readme = "README.md"
repository = "https://github.com/ImageOptim/gifski"
version = "1.5.3"
version = "1.6.0"
autobins = false
edition = "2018"

Expand All @@ -23,7 +23,7 @@ gifsicle = { version = "1.92.5", optional = true }
clap = "2.34.0"
gif = "0.11.3"
gif-dispose = "3.1.1"
imagequant = "3.1.0"
imagequant = "4.0.0-beta.2"
imgref = "1.9.1"
lodepng = "3.4.7"
pbr = "1.0.4"
Expand All @@ -44,8 +44,8 @@ features = ["codec", "format", "filter", "software-resampling", "software-scalin

[features]
default = ["gifsicle"]
openmp = ["imagequant/openmp"]
openmp-static = ["openmp", "imagequant/openmp-static"]
openmp = [] # deprecated, obsolete
openmp-static = [] # deprecated, obsolete
video = ["ffmpeg"]
video-static = ["video", "ffmpeg/build"]

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ impl Writer {
100 // the first frame is too important to ruin it
};
liq.set_quality(0, quality);
let mut img = liq.new_image_stride_copy(image.buf(), image.width(), image.height(), image.stride(), 0.)?;
let mut img = liq.new_image_stride(image.buf(), image.width(), image.height(), image.stride(), 0.)?;
img.set_importance_map(importance_map)?;
if has_prev_frame {
img.add_fixed_color(RGBA8::new(0, 0, 0, 0));
}
let res = liq.quantize(&img)?;
let res = liq.quantize(&mut img)?;
Ok((liq, res, img))
}

Expand Down

0 comments on commit 3a29451

Please sign in to comment.