Skip to content

Commit

Permalink
Release 0.8.0 (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
blaind authored Jul 4, 2023
1 parent e33c6b0 commit f61477f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 21 deletions.
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Changelog

[git_tag_comparison]: https://github.com/blaind/webp-animation/compare/v0.7.0...main
[View unreleased changes](https://github.com/blaind/webp-animation/compare/v0.8.0...main)

## Version 0.8.0 (2023-07-04)

[Compare changelog](https://github.com/blaind/webp-animation/compare/v0.7.0...v0.8.0)

### Added

- [Add non-alpha RGB and BGR color modes][14]
- [Add animation parameters configuration, allowing loop count configuration][15]

### Changed

- [Rename `timestamp` parameter into `timestamp_ms`][16]
- [Improve finanlize function documentation][17]
- Earlier minimum supported rust version 1.47 was not tested for and did not work, now CI-tested with 1.63
- [Update env_logger dev dependency to 0.10.0][10]

## Version 0.7.0 (2022-07-21)

Expand Down Expand Up @@ -39,3 +55,8 @@

[2]: https://github.com/blaind/webp-animation/pull/2
[3]: https://github.com/blaind/webp-animation/pull/8
[10]: https://github.com/blaind/webp-animation/pull/10
[14]: https://github.com/blaind/webp-animation/pull/14
[15]: https://github.com/blaind/webp-animation/pull/15
[16]: https://github.com/blaind/webp-animation/pull/16
[17]: https://github.com/blaind/webp-animation/pull/17
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "webp-animation"
version = "0.7.0"
version = "0.8.0"
authors = ["Mika Vatanen <[email protected]>"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
45 changes: 26 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
[crates.io]: https://crates.io/crates/webp-animation
[Lines of Code]: https://tokei.rs/b1/github/blaind/webp-animation?category=code
[github]: https://github.com/blaind/webp-animation

[Docs Version]: https://docs.rs/webp-animation/badge.svg
[docs]: https://docs.rs/webp-animation

Expand All @@ -15,25 +14,28 @@ A high-level Rust wrapper for decoding and encoding

![Example](data/example.gif)

*See `examples/encode_animation.rs` for source code of encoding the above image - example converted to gif for all-browser support, see the [example.webp file](data/example.webp)*
_See `examples/encode_animation.rs` for source code of encoding the above image - example converted to gif for all-browser support, see the [example.webp file](data/example.webp)_

Underlying WebP format processing is handled by C-based
[libwebp](https://developers.google.com/speed/webp/docs/container-api) library,
which is interfaced through Rust [libwebp-sys2](https://crates.io/crates/libwebp-sys2)
crate.

Functional Goals:
* Easy-to-use API that looks like Rust
* Enable decoding and encoding of WebP streams
* All configuration flags provided by `libwebp` should be usable

- Easy-to-use API that looks like Rust
- Enable decoding and encoding of WebP streams
- All configuration flags provided by `libwebp` should be usable

Non-functional Goals:
* High performance (approach `libwebp` performance without large overhead)
* Write compherensive test cases, and test by automation
* Ensure safety (no memory leaks or UB). Fuzz the API's. Safe to use for end users

- High performance (approach `libwebp` performance without large overhead)
- Write compherensive test cases, and test by automation
- Ensure safety (no memory leaks or UB). Fuzz the API's. Safe to use for end users

Non-goals
* Provide other WebP/libwebp -related functionality (such as image en/decoding or muxing). For this functionality, see e.g. [libwebp-image](https://crates.io/crates/libwebp-image) or [webp](https://crates.io/crates/webp)

- Provide other WebP/libwebp -related functionality (such as image en/decoding or muxing). For this functionality, see e.g. [libwebp-image](https://crates.io/crates/libwebp-image) or [webp](https://crates.io/crates/webp)

## Examples

Expand Down Expand Up @@ -83,26 +85,29 @@ let dark_frame = [0, 0, 0, 255].repeat(64 * 32);
let mut encoder = Encoder::new(dimensions).unwrap();

// insert frames to specific (increasing) timestamps
for i in 0..5 {
let rgba_data = if i % 2 == 0 {
for frame_idx in 0..5 {
let rgba_data = if frame_idx % 2 == 0 {
&bright_frame
} else {
&dark_frame
};

let frame_timestamp = i * 170;
// (presentation) timestamp of the frame, should be in increasing order. represented in milliseconds
let frame_timestamp_ms = frame_idx * 170;

encoder.add_frame(rgba_data, frame_timestamp).unwrap();
encoder.add_frame(rgba_data, frame_timestamp_ms).unwrap();
}

// final timestamp in milliseconds, until to the last frame is shown
let final_timestamp_ms = 1_000;

// get encoded webp data
let final_timestamp = 1_000;
let webp_data = encoder.finalize(final_timestamp).unwrap();
let webp_data = encoder.finalize(final_timestamp_ms).unwrap();
std::fs::write("my_animation.webp", webp_data).unwrap();
```

See [docs](https://docs.rs/webp-animation/0.1.3/webp_animation/) for other encoding options, e.g.
for lossy encoding.
See the [documentation](https://docs.rs/webp-animation/latest/webp_animation) for other encoding options, e.g.
for lossy encoding. For tuning the options, use the [`Encoder::new_with_options`](https://docs.rs/webp-animation/latest/webp_animation/struct.Encoder.html#method.new_with_options) method.

## Future plans

Expand All @@ -113,11 +118,13 @@ Possibly provide a compherensive CLI for working with WebP animations in future
## License

Licensed under either of
* <a href="LICENSE-APACHE">Apache License, Version 2.0</a> or
* <a href="LICENSE-MIT">MIT license</a>

- <a href="LICENSE-APACHE">Apache License, Version 2.0</a> or
- <a href="LICENSE-MIT">MIT license</a>

at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the software by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

0 comments on commit f61477f

Please sign in to comment.