mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Implement content-addressed resource storage for raster images (#4148)
* Implement content-addressed resource storage * Implement OPFS resource storage * Remove ResourceStorage::read * Review
This commit is contained in:
@@ -55,10 +55,6 @@ enum Command {
|
||||
#[clap(long, short = 'o')]
|
||||
output: PathBuf,
|
||||
|
||||
/// Optional input image resource
|
||||
#[clap(long)]
|
||||
image: Option<PathBuf>,
|
||||
|
||||
/// Scale factor for export (default: 1.0)
|
||||
#[clap(long, default_value = "1.0")]
|
||||
scale: f64,
|
||||
@@ -121,11 +117,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
let document_string = std::fs::read_to_string(document_path).expect("Failed to read document");
|
||||
|
||||
log::info!("Creating GPU context");
|
||||
let mut application_io = block_on(PlatformApplicationIo::new());
|
||||
|
||||
if let Command::Export { image: Some(ref image_path), .. } = app.command {
|
||||
application_io.resources.insert("null".to_string(), Arc::from(std::fs::read(image_path).expect("Failed to read image")));
|
||||
}
|
||||
let application_io = block_on(PlatformApplicationIo::new());
|
||||
|
||||
// Convert application_io to Arc first
|
||||
let application_io_arc = Arc::new(application_io);
|
||||
|
||||
Reference in New Issue
Block a user