mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-07 12:05:34 +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
|
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 {
|
||||||
dynamic_image.resize(width, height, FILTER)
|
dynamic_image.resize(width, height, FILTER)
|
||||||
|
}else{
|
||||||
|
dynamic_image.resize(width*2, height*2, FilterType::Nearest).resize(width, height, FILTER)
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dynamic_image
|
dynamic_image
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user