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

  1. Upload a 2000x430px slide to the website
  2. Check the homepage for the slide
  3. It does not load

Expected behaviour

  1. Upload a 2000x430px slide to the website
  2. Check the homepage for the slide
  3. 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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information