8 releases

✓ Uses Rust 2018 edition

0.2.0 Jun 11, 2019
0.1.6 Jun 11, 2019

#102 in Images

Download history 24/week @ 2019-11-01 1/week @ 2019-11-08 17/week @ 2019-11-15 9/week @ 2019-11-22 16/week @ 2019-11-29 80/week @ 2019-12-06 8/week @ 2019-12-27 88/week @ 2020-01-10 56/week @ 2020-01-17 8/week @ 2020-02-07

75 downloads per month

MIT license

48KB
1K SLoC

giffy

Build Status crates.io

A simple GIF decoder written in Rust.

Usage

use giffy;
use std::fs::File;

let mut src = File::open("<gif path>").expect("File not found");
match giffy::load(&mut src) {
    Ok(gif) => {
        for frame in gif.image_frames {
            // do something with the frame
        }
    }

    Err(e) => {
        eprintln!("Error: {}", e);
    }
}

Try it

cargo run --example example <GIF file path> <output folder path>

This example splits the <GIF file path> into individual images and save it in the <output folder path>.

Disclaimer

At this time, this decoder is meant to be for educational/learning purposes only.


lib.rs:

giffy is a simple GIF decoder.

Example

use giffy;
use std::fs::File;

let mut src = File::open("<gif path>").expect("File not found");
match giffy::load(&mut src) {
    Ok(gif) => {
        for frame in gif.image_frames {
            // do something with the frame
        }
    }

    Err(e) => {
        eprintln!("Error: {}", e);
    }
}

No runtime deps