Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various bugfixes for cropping & rotation handling #220

Merged
merged 11 commits into from
Feb 27, 2023
Merged

Conversation

stefan-it
Copy link
Contributor

Hi,

this PR fixes various cropping & rotation handling bugs:

  • Calculation of image boundary exceeding was done wrong: when e.g. image is rotated 90 or 270 degrees, the image dimensions switch. Refactored image boundary exceeding check was added to work with rotation at 90 and 270 degrees.
  • In some cases, negative coordinates for region width and height could occur
  • Also in some cases, region width and height could be less than the user-defined values. This was due to the fact, that Math.min was used. A new function was added that checks, if the calculates value for region width and height is >= the user-defined value.
  • An extensive unit test was added, that uses a sliding window approach: a rectangle slides over an input image and rotation operations (90, 180 and 270 degress) are performed. The returned image is checked to match the user-defined dimensions. This check shows that no regression bugs were introduced with the new rotation handling and the library is now more robust when using rotation operations.

@stefan-it stefan-it merged commit 9a24c2c into main Feb 27, 2023
@stefan-it stefan-it deleted the crop-rotation-bug branch February 27, 2023 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants