Function render_image

Source
pub fn render_image(
    bytes: &[u8],
    size: Option<u32>,
) -> Result<RenderedImage, String>
Expand description

Validate an image and optionally produce a thumbnail for a client response.

size bounds the longest axis, from 1 through 2048 pixels. An image already within that bound is returned byte-for-byte. A larger image is resampled in memory and encoded as PNG; the original remains untouched. The same input, decoded-memory, dimension and cooperative time limits as write_image apply. This is response rendering, not an artwork download/conversion pass.