fix: use resize_exact instead of resize
It seems we used the wrong method in the past, causing images to not be the expected size. The image-fit test shows this well, I think.
@ -98,7 +98,7 @@ fn scale_image(
|
|||||||
ImageScaling::Pixelated => FilterType::Nearest,
|
ImageScaling::Pixelated => FilterType::Nearest,
|
||||||
_ => FilterType::Lanczos3, // downscale
|
_ => FilterType::Lanczos3, // downscale
|
||||||
};
|
};
|
||||||
buf = image.resize(w, h, filter);
|
buf = image.resize_exact(w, h, filter);
|
||||||
&buf
|
&buf
|
||||||
};
|
};
|
||||||
for ((_, _, src), dest) in resized.pixels().zip(pixmap.pixels_mut()) {
|
for ((_, _, src), dest) in resized.pixels().zip(pixmap.pixels_mut()) {
|
||||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |