YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix: explicitly flush BufWriter after JPEG encoding in snapshot writer
Louis Beaumont8fe14b644995
diff --git a/crates/screenpipe-screen/src/snapshot_writer.rs b/crates/screenpipe-screen/src/snapshot_writer.rsindex ad5e6409b..110998abc 100644--- a/crates/screenpipe-screen/src/snapshot_writer.rs+++ b/crates/screenpipe-screen/src/snapshot_writer.rs@@ -12,7 +12,7 @@ use chrono::{DateTime, Utc};use image::codecs::jpeg::JpegEncoder;use image::DynamicImage;use std::fs;-use std::io::BufWriter;+use std::io::{BufWriter, Write};use std::path::{Path, PathBuf};use tracing::{debug, error};@@ -53,9 +53,10 @@ impl SnapshotWriter {let path = date_dir.join(&filename);let file = fs::File::create(&path)?;- let writer = BufWriter::new(file);- let mut encoder = JpegEncoder::new_with_quality(writer, self.quality);+ let mut writer = BufWriter::new(file);+ let mut encoder = JpegEncoder::new_with_quality(&mut writer, self.quality);encoder.encode_image(image)?;+ writer.flush()?;debug!("snapshot written: {} ({}x{}, q={})",