fix image preview
This commit is contained in:
@@ -24,6 +24,14 @@ pub fn get_pause_state(state: tauri::State<'_, AppState>) -> bool {
|
||||
state.is_paused.load(Ordering::SeqCst)
|
||||
}
|
||||
|
||||
use base64::{engine::general_purpose, Engine as _};
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_image_base64(path: String) -> Result<String, String> {
|
||||
let bytes = fs::read(path).map_err(|e| e.to_string())?;
|
||||
Ok(general_purpose::STANDARD.encode(bytes))
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_timeline(date: String, base_dir: String) -> Vec<serde_json::Value> {
|
||||
let mut results = Vec::new();
|
||||
|
||||
Reference in New Issue
Block a user