More efficient way to handle big images by at first using a nearest filter

This commit is contained in:
azy 2025-02-07 11:53:31 +08:00
parent c92c05f40f
commit 5a3227edef

View File

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