Commit 8a5c313
committed
Fix and improve the interpolation logic in resize_image()
The original code had a mistake. It used 'lanczos' when the image got smaller (width > resized_width and height > resized_height) and 'area' when it stayed the same or got bigger. This was the wrong way. 'area' is better for big shrinking.
We changed it so 'area' is used only when the image shrinks a lot (to half its size or smaller). This is because 'area' works best for making images much smaller. For other cases, 'lanczos' is used instead.1 parent ede3470 commit 8a5c313
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | | - | |
425 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
426 | 429 | | |
427 | 430 | | |
428 | 431 | | |
| |||
0 commit comments