Jump to content

rounding issues in imagesizer


horst
 Share

Recommended Posts

While testing with ImageSizer and ImagickResizer I have encountered that there are some glitches in the dimension calculations.

 

A simple testcase I have used is to downsize an image to the half of a dimension and -1, -2, -3, +1, +2, +3 pixels.

 

This results in 5 failures:

post-1041-0-96689400-1399150602_thumb.pn

 

After wrapping a ceil() here and here, there were only 2 failures and 5 succeeds:

post-1041-0-82759800-1399150604_thumb.pn

 

Therefor I have changed this floor to round, and this one too. This results in 7 succeeds:

post-1041-0-69270800-1399150606_thumb.pn

 

I send a pull request and refer to this post here, (because I do not know how to embedd images in a github pull-request or comment. :)

 

 

---

PS: only changing the floors to rounds and not wrapping the ceils results in 5 succeeds and 2 failures :)

Edited by horst
  • Like 3
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...