You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libwebp-sys2-rs is designed to be a handwritten translation of libwebp(C)'s public headers, and these public headers evolve between versions. The version-numbered features, such as 0_5, 0_6, and 1_2 are just meant to switch header versions. Therefore there are three possibilities for the behavioral inconsistency:
libwebp(C) behaves differently based on the difference in its header versions.
libwebp-sys2-rs does not correctly translate libwebp(C)'s public headers.
Some sort of Rube Goldberg machine, possibly involving undefined behaviors.
And technically, libwebp-sys2-rs defines slightly different interfaces based on its version-numbered features because the original headers do so. Especially,
Some of the structs, including WebPConfig, often have different fields of different sizes. I expect libwebp(C) to be designed so that the changes are backwards-compatible, but I'm not 100% sure.
It declares different ABI versions, which are passed to the library during initialization. libwebp(C) may be using it to switch behaviors, though I think this is fairly unlikely.
Animation with feature
1_2
Animation with feature
0_5
Description
Both files were generated using this exact code, just clone it and
cargo run --bin=screenshot
:https://github.com/walles/loadviz/blob/b19b25e91687b274db487cb4f9daeee9ce82b580/libloadviz/src/bin/screenshot.rs
If you change the required feature from
1_2
to0_5
without any changes to the Rust code, you'll get the blurry screenshot when running the program.Expectations
I expected enabling features would give me things like "now you can encode animations!". And it does, this is good.
I did not expect enabling features heavily affecting the quality of the output. But it does, I think this was bad.
Also, I think this behavior is really un-obvious, so maybe
0_5
should be removed? Or fixed if there's something wrong with it messing up the quality?Notes
Since GitHub doesn't support uploading WEBP images (please vote for it!) I used this trick for that. They are really WEBPs, no matter what the file extensions say.
The text was updated successfully, but these errors were encountered: