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:
Timon
2026-05-21 19:31:07 +00:00
committed by GitHub
parent 21d2994059
commit 2770df7567
50 changed files with 1535 additions and 355 deletions

View File

@@ -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);