Skip to content

Commit

Permalink
Update Rust gif crate
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Oct 10, 2020
1 parent 7ecefd8 commit 0839245
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 45 deletions.
91 changes: 49 additions & 42 deletions Cargo.lock

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

8 changes: 5 additions & 3 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.2.1"
version = "1.2.2"
autobins = false
edition = "2018"

Expand All @@ -21,8 +21,8 @@ name = "gifski"
[dependencies]
gifsicle = { version = "1.92.1", optional = true }
clap = "2.33.3"
gif = "0.10.3"
gif-dispose = "2.4.1"
gif = "0.11"
gif-dispose = "3"
imagequant = "2.12.5"
imgref = "1.7.0"
lodepng = "3.2.1"
Expand All @@ -36,6 +36,8 @@ dunce = "1.0.1"
crossbeam-channel = "0.4.3"

[dependencies.ffmpeg]
# package = "ffmpeg-next"
# version = "4.3.6"
git = "https://github.com/kornelski/rust-ffmpeg"
optional = true
default-features = false
Expand Down
12 changes: 12 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ quick_error! {
Gifsicle {
display("gifsicle failure")
}
Gif(err: gif::EncodingError) {
display("GIF encoding error: {}", err)
}
NoFrames {
display("Found no usable frames to encode")
}
Expand All @@ -40,6 +43,15 @@ quick_error! {

pub type CatResult<T, E = Error> = Result<T, E>;

impl From<gif::EncodingError> for Error {
fn from(err: gif::EncodingError) -> Self {
match err {
gif::EncodingError::Io(err) => err.into(),
other => Error::Gif(other),
}
}
}

impl<T> From<crossbeam_channel::SendError<T>> for Error {
fn from(_: crossbeam_channel::SendError<T>) -> Self {
Self::ThreadSend
Expand Down

0 comments on commit 0839245

Please sign in to comment.