Add option to export original images

This commit is contained in:
Joscha 2025-04-06 11:46:33 +02:00
parent c8fb228a24
commit dad0f282c6
5 changed files with 51 additions and 20 deletions

View file

@ -33,6 +33,11 @@ struct Args {
/// Export an image of whatever is printed here.
#[arg(long, short)]
export: Option<PathBuf>,
/// Export the original images printed by the image document, before
/// dithering or other manipulation.
#[arg(long, short)]
originals: Option<PathBuf>,
}
fn main() -> anyhow::Result<()> {
@ -44,7 +49,7 @@ fn main() -> anyhow::Result<()> {
let mut drawer = Drawer::new(rx, printer);
let runtime = Runtime::new()?;
runtime.spawn(server::run(tx.clone(), args.address));
runtime.spawn(server::run(tx.clone(), args.address, args.originals));
runtime.spawn(async move {
loop {
let _ = tx.send(Command::Backlog).await;