Expand description
webpsan is a WebP format “sanitizer”.
The sanitizer currently simply checks the validity of a WebP file input, so that passing a malformed filed to an unsafe parser can be avoided.
Usage
The main entry points to the sanitizer is sanitize, which take a Read + Skip input. The Skip trait
represents a subset of the Seek trait; an input stream which can be skipped forward, but not necessarily seeked
to arbitrary positions.
let example_input = b"RIFF\x14\0\0\0WEBPVP8L\x08\0\0\0\x2f\0\0\0\0\x88\x88\x08";
webpsan::sanitize(std::io::Cursor::new(example_input))?;The parse module also contains a less stable and undocumented API which can be used to parse individual WebP
chunk types.
Modules
- Unstable API for parsing WebP files.
Structs
- Configuration for the WebP sanitizer.
- Builder for
Config. - A report with additional debugging info for an error.
Enums
- Error type for ConfigBuilder
Constants
- Maximum file length as permitted by WebP.
Traits
- A subset of the [
Seek] trait, providing a cursor which can skip forward within a stream of bytes.
Functions
- Sanitize a WebP input.
- Sanitize a WebP input, with the given
Config.
Type Aliases
- Error type returned by
webpsan.