[][src]Function libwebp::WebPGetInfo

pub fn WebPGetInfo(data: &[u8]) -> Result<(u32, u32), WebPSimpleError>

Retrieve basic header information: width, height.

This function will also validate the header, returning Ok((width, height)) on success, Err(_) otherwise.

Errors

Returns Err if data doesn't contain a valid WebP header.

Examples

use libwebp::WebPGetInfo;

let data: &[u8];

let (width, height) = WebPGetInfo(data).expect("Invalid WebP data");