Skip to main content

decode

Function decode 

Source
fn decode(
    bytes: &[u8],
    shape: ImageShape,
    max_decoded_bytes: u64,
    scale: f32,
) -> Result<LoadedImage, String>
Expand description

Decode bytes into pixels in the form shape, at the size they are shown at on a screen of scale pixels to the point, refusing a picture that would decode larger than max_decoded_bytes. The format is told from the bytes themselves, not from the address or what the server called it.