fix: prevent image quality degradation by switching to higher-quality Triangle filter and skipping resize for correctly sized images

This commit is contained in:
nekename committed 2026-10-03 17:30:28 +01:00
1 parent 2de61f3e19
commit ad265d629c
1 file changed
+5 -1
+5 -1
View File
@@ -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 {