From f61477f387fc74eb3786d03c2355268917b75585 Mon Sep 17 00:00:00 2001 From: Mika Date: Tue, 4 Jul 2023 13:09:15 +0300 Subject: [PATCH] Release 0.8.0 (#18) --- CHANGELOG.md | 23 ++++++++++++++++++++++- Cargo.toml | 2 +- README.md | 45 ++++++++++++++++++++++++++------------------- 3 files changed, 49 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index faa60b1..3c22d16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) @@ -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 diff --git a/Cargo.toml b/Cargo.toml index e35d202..82a1b85 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "webp-animation" -version = "0.7.0" +version = "0.8.0" authors = ["Mika Vatanen "] license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/README.md b/README.md index a4fe3a2..9a266d3 100644 --- a/README.md +++ b/README.md @@ -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 @@ -15,7 +14,7 @@ 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, @@ -23,17 +22,20 @@ which is interfaced through Rust [libwebp-sys2](https://crates.io/crates/libwebp 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 @@ -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 @@ -113,11 +118,13 @@ Possibly provide a compherensive CLI for working with WebP animations in future ## License Licensed under either of -* Apache License, Version 2.0 or -* MIT license + +- Apache License, Version 2.0 or +- MIT license 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.