@@ -4,6 +4,7 @@ use notedeck::ImageCache;
|
|||||||
use notedeck::Result;
|
use notedeck::Result;
|
||||||
use poll_promise::Promise;
|
use poll_promise::Promise;
|
||||||
use std::path;
|
use std::path;
|
||||||
|
use std::path::PathBuf;
|
||||||
use tokio::fs;
|
use tokio::fs;
|
||||||
|
|
||||||
//pub type ImageCacheKey = String;
|
//pub type ImageCacheKey = String;
|
||||||
@@ -198,6 +199,10 @@ fn fetch_img_from_disk(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn fetch_binary_from_disk(path: PathBuf) -> Result<Vec<u8>> {
|
||||||
|
std::fs::read(path).map_err(|e| notedeck::Error::Generic(e.to_string()))
|
||||||
|
}
|
||||||
|
|
||||||
/// Controls type-specific handling
|
/// Controls type-specific handling
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
pub enum ImageType {
|
pub enum ImageType {
|
||||||
|
|||||||
Reference in New Issue
Block a user