Function image::save_buffer_with_format[][src]

pub fn save_buffer_with_format<P>(
    path: P,
    buf: &[u8],
    width: u32,
    height: u32,
    color: ColorType,
    format: ImageFormat
) -> ImageResult<()> where
    P: AsRef<Path>, 

Saves the supplied buffer to a file at the path specified in the specified format.

The buffer is assumed to have the correct format according to the specified color type. This will lead to corrupted files if the buffer contains malformed data. Currently only jpeg, png, ico, bmp and tiff files are supported.