#gif #image

bin+lib gift

A library for reading and writing GIF images

7 releases (4 breaking)

✓ Uses Rust 2018 edition

new 0.5.0 Mar 28, 2020
0.4.0 Feb 26, 2020
0.3.1 May 29, 2019
0.2.0 May 1, 2019
0.1.1 Apr 28, 2019

#183 in Encoding

Download history 10/week @ 2019-11-29 192/week @ 2019-12-06 5/week @ 2019-12-27 55/week @ 2020-01-10 35/week @ 2020-01-17 1/week @ 2020-01-24 5/week @ 2020-02-07 3/week @ 2020-02-14 28/week @ 2020-02-21 18/week @ 2020-02-28 15/week @ 2020-03-06 8/week @ 2020-03-13

66 downloads per month

MIT/Apache

93KB
2.5K SLoC

GIFt

A Rust library for encoding and decoding GIF images.

Documentation

https://docs.rs/gift

Decoding example

// ... open a `File` as "gif"
for raster in gift::Decoder::new(gif) {
    // was there a decoding error?
    let raster = raster?;
    // ... work with raster
}

Utility

The library comes with a gift command-line utility, which can show the blocks within GIF files.

cargo install gift --features=cmd

TODO

  • Interlaced images

lib.rs:

GIFt

A library for decoding and encoding GIF images and animations.

Decode Example

# fn main() -> Result<(), Box<dyn std::error::Error>> {
# let gif = &[
#   0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x02, 0x00,
#   0x02, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00,
#   0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00,
#   0x02, 0x00, 0x02, 0x00, 0x00, 0x02, 0x03, 0x0c,
#   0x10, 0x05, 0x00, 0x3b,
# ][..];
// ... open a `File` as "gif"
for raster in gift::Decoder::new(gif) {
    // was there a decoding error?
    let raster = raster?;
    // ... work with raster
}
# Ok(())
# }

Dependencies

~205–710KB
~15K SLoC