[−][src]Function raster::open
pub fn open(image_file: &str) -> RasterResult<Image>
Create an image from an image file.
Errors
This function can return RasterError::Io
, RasterError::Decode
, or
RasterError::UnsupportedFormat
upon failure.
See error module for more info.
Examples
// Create an image from file let image = raster::open("tests/in/sample.png").unwrap(); println!("{:?}", image.bytes);