Skip to main content

save_png

Function save_png 

Source
pub async fn save_png(
    conn: &mut SqliteConnection,
    media_dir: &Path,
    existing: Option<MediaId>,
    file_name: Option<&str>,
    png: &[u8],
    width: u32,
    height: u32,
) -> Result<MediaId, AppError>
Expand description

file_name is the path relative to media_dir. None picks a uuid name. When existing is Some, the row’s current path is kept.