From 229f12f5ff836ffa36d21023589fe3955df3f21d Mon Sep 17 00:00:00 2001 From: clover caruso Date: Sat, 3 Oct 2026 22:49:14 -0700 Subject: [PATCH] fix: preserve colors when copying translucent pictures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverse the renderer’s linear-light premultiplication before encoding non-PNG pictures for the clipboard. Cover translucent TIFF colors alongside exact PNG alpha. Refs #80 Assisted-by: gpt-6.1-sol --- crates/snowbound/src/paste.rs | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/crates/snowbound/src/paste.rs b/crates/snowbound/src/paste.rs index ca1da6c330c9981b307f812d987930fee18fb0ea..990c9a751170cac6a3b0c1f8e4534b52b3dd090c 100644 --- a/crates/snowbound/src/paste.rs +++ b/crates/snowbound/src/paste.rs @@ -53,12 +53,10 @@ pub(crate) fn pixels(encoded: &[u8]) -> Result<([u32; 2], Vec), Box) -> Vec { let mut bytes = Vec::new(); let mut encoder = png::Encoder::new(&mut bytes, 200, 100); -- 2.54.0