From a4dc1c82ed2ad02c9c6d463d4c259a5fc05ee1d8 Mon Sep 17 00:00:00 2001 From: psykose Date: Mon, 25 Nov 2024 17:16:02 +0100 Subject: [PATCH] fix image saving in some cases --- src/ui/window.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ui/window.rs b/src/ui/window.rs index 00ba91a..32b10e1 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -792,6 +792,8 @@ mod imp { } let resized = image_copy.resize(400, 400, image::imageops::FilterType::Lanczos3); + // resize reoutputs rgba image; we can't save an rgba jpeg + let resized = image::DynamicImage::ImageRgb8(resized.into()); resized.save_with_format(&save_path_copy, image::ImageFormat::Jpeg)?; *mpris_art_path = Some(save_path_copy); Ok(())