Fitting 2000x430 images to 2000x430 does not work
/label bug priority: medium
One-sentence description
Fitting 2000x430 images to 2000x430 does not work
Current behaviour / Reproducing the bug
- Upload a 2000x430px slide to the website
- Check the homepage for the slide
- It does not load
Expected behaviour
- Upload a 2000x430px slide to the website
- Check the homepage for the slide
- It does load
Upstream problem
This is caused by a precision problem in Pillow. The ImageOps.fit
method calculates a box to crop the image in.
Since the image is the same the calculation made is as follows:
>>> 2000/430 * 430
2000.0000000000002
This is then used 2000-(2000/430 * 430)
and the box has a left value that is negative causing an exception.
Edited by Ghost User