fn make_thumbnail(path: &Path) -> TransformResult<()> {
    let filename = path.file_name().ok_or(TransformError::NoFileName)?;
    let parent = path.parent().ok_or(TransformError::NoParentDir)?;
    let thumbnail_path = parent.join(".hc_thumbs").with_file_name(filename).with_extension("jpg");
    ImageReader::open(path)
        .map_err(TransformError::Open)?
        .decode()
        .map_err(TransformError::Decode)?
        .thumbnail(100, 100)
        .save(thumbnail_path)
        .map_err(TransformError::Save)
}
/// Takes an image at the provided path and creates a thumbnail of it. The
/// thumbnail is saved in same path with the same name as the original file,
/// but in a new folder named .hc_thumbs.
Takes an image at the provided path and creates a thumbnail of it. The
thumbnail is saved in same path with the same name as the original file,
but in a new folder named .hc_thumbs.
Takes an image at the provided path and creates a thumbnail of it . The thumbnail is saved in same path with the same name as the original file but in a new folder named . hc_thumbs .
fn make_thumbnail(path: &Path) -> TransformResult<()> {
    let filename = path.file_name().ok_or(TransformError::NoFileName)?;
    let parent = path.parent().ok_or(TransformError::NoParentDir)?;
    let thumbnail_path = parent.join(".hc_thumbs").with_file_name(filename).with_extension("jpg");
    ImageReader::open(path)
        .map_err(TransformError::Open)?
        .decode()
        .map_err(TransformError::Decode)?
        .thumbnail(100, 100)
        .save(thumbnail_path)
        .map_err(TransformError::Save)
}
fn make_thumbnail ( path : & Path ) -> TransformResult < ( ) > { let filename = path . file_name ( ) . ok_or ( TransformError :: NoFileName ) ? ; let parent = path . parent ( ) . ok_or ( TransformError :: NoParentDir ) ? ; let thumbnail_path = parent . join ( " " ) . with_file_name ( filename ) . with_extension ( " " ) ; ImageReader :: open ( path ) . map_err ( TransformError :: Open ) ? . decode ( ) . map_err ( TransformError :: Decode ) ? . thumbnail ( 100 , 100 ) . save ( thumbnail_path ) . map_err ( TransformError :: Save ) }
Takes an image at the provided path and creates a thumbnail of it.
Takes an image at the provided path and creates a thumbnail of it .
path
&Path
path
&Path