fix image saving in some cases

This commit is contained in:
psykose 2024-11-25 17:16:02 +01:00
parent 23c006fe7b
commit a4dc1c82ed
Signed by: psykose
SSH key fingerprint: SHA256:pRMVjV3kRB6zl+wNx+sV8KoMnPqQAW6v8dNCxsCGZv8

View file

@ -792,6 +792,8 @@ mod imp {
} }
let resized = let resized =
image_copy.resize(400, 400, image::imageops::FilterType::Lanczos3); 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)?; resized.save_with_format(&save_path_copy, image::ImageFormat::Jpeg)?;
*mpris_art_path = Some(save_path_copy); *mpris_art_path = Some(save_path_copy);
Ok(()) Ok(())