use std::env;
use std::path::Path;
use image::io::Reader as ImageReader;
use image::DynamicImage;
pub fn path_cwd(file_path: &str) -> String {
let cur_dir = env::current_dir().unwrap();
let cwd = cur_dir.to_str().unwrap();
format!("{}/{}", cwd, file_path)
}
pub fn file_name_from_path(file_path: &str) -> String {
Path::new(file_path).file_name().unwrap().to_str().unwrap().to_string()
}
pub fn file_folder_from_path(file_path: &str) -> String {
Path::new(file_path).parent().unwrap().display().to_string()
}
pub fn file_ext_from_path(file_path: &str) -> String {
Path::new(file_path).extension().unwrap().to_str().unwrap().to_string()
}
pub fn open_image(file_path: &str) -> DynamicImage {
ImageReader::open(file_path).unwrap().decode().unwrap()
}