mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-06 03:25:23 +00:00
More efficient way to handle big images by at first using a nearest filter
This commit is contained in:
parent
c92c05f40f
commit
5a3227edef
@ -19,7 +19,12 @@ impl Image {
|
||||
let image = if dynamic_image.height() > height
|
||||
|| dynamic_image.width() > width
|
||||
{
|
||||
dynamic_image.resize(width, height, FILTER)
|
||||
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
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user