mirror of
https://github.com/OpenActionAPI/rust-elgato-streamdeck.git
synced 2026-10-28 09:44:56 +00:00
fix: prevent image quality degradation by switching to higher-quality Triangle filter and skipping resize for correctly sized images
This commit is contained in:
1 file changed
+5
-1
+5
-1
@@ -26,7 +26,11 @@ pub fn convert_image_with_format(image_format: ImageFormat, image: DynamicImage)
|
||||
ImageRotation::Rot270 => image.rotate270(),
|
||||
};
|
||||
|
||||
let image = image.resize_exact(ws as u32, hs as u32, FilterType::Nearest);
|
||||
let image = if image.dimensions() == (ws as u32, hs as u32) {
|
||||
image
|
||||
} else {
|
||||
image.resize_exact(ws as u32, hs as u32, FilterType::Triangle)
|
||||
};
|
||||
|
||||
// Applying mirroring
|
||||
let image = match image_format.mirror {
|
||||
|
||||
Reference in new issue
Block a user