DescriptionThe image resizing code first calculates the optimum ratio to reduce the image by, then calculates the dimensions, and checks which one hasn't changed to set the other.
The problem is, when the image is 600x400 and it is to be resized to 171x171, the result of the calculation for the new image is 170.999999997, which gets truncated to 170 instead of 171, the code doesn't set the other dimension and the image gets resized to 171x171 instead of 171x114.
This patch makes the code use Math.round to avoid such things happening.
Note that the change also includes a 600x400 GIF file, but as it's a binary, diff didn't pick it up. it can be easily recreated for final submission as long as it's that size.
Patch Set 1 #
MessagesTotal messages: 3
|