Function engiffen::load_image [] [src]

pub fn load_image<P>(path: P) -> Result<Image, Error> where
    P: AsRef<Path>, 

Loads an image from the given file path.

Examples

let image = load_image("test/ball/ball01.bmp")?;
assert_eq!(image.path, Some(PathBuf::from("test/ball/ball01.bmp")));

Errors

Returns an error if the path can't be read or if the image can't be decoded