Skip to main content

convert

Function convert 

Source
pub fn convert(bytes: &[u8]) -> Result<Option<Converted>, ConvertError>
Expand description

Converts an image into the limits of the API.

Returns None when the image passes as it is, so that it keeps its bytes.

ยงErrors

Returns ConvertError::Decode if the image does not decode, and ConvertError::Size if no scale fits it.