All images are always resized by nearest if possible/needed

This commit is contained in:
azy 2025-02-07 12:03:08 +08:00
parent 269f3880d7
commit 4e17db2f04

View File

@ -19,12 +19,15 @@ impl Image {
let image = if dynamic_image.height() > height let image = if dynamic_image.height() > height
|| dynamic_image.width() > width || dynamic_image.width() > width
{ {
if dynamic_image.height() <= height*2 && dynamic_image.width() <= width*2 { if dynamic_image.height() <= height * 2
&& dynamic_image.width() <= width * 2
{
dynamic_image.resize(width, height, FILTER) dynamic_image.resize(width, height, FILTER)
}else{ } else {
dynamic_image.resize(width*2, height*2, FilterType::Nearest).resize(width, height, FILTER) dynamic_image
.resize(width * 2, height * 2, FilterType::Nearest)
.resize(width, height, FILTER)
} }
} else { } else {
dynamic_image dynamic_image
}; };