Crate webpsan

source ·
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

Enums

Constants

Traits

  • A subset of the [Seek] trait, providing a cursor which can skip forward within a stream of bytes.

Functions

Type Aliases

  • Error type returned by webpsan.