Skip to content

Conversation

@black-turtle
Copy link
Contributor

@black-turtle black-turtle commented Feb 25, 2023

Closes #1101

What's Changing

Changing rotate algorithm if angle is multiple of 90 degree. For other rotate angle previous algorithm will be used.

Why Changing

  • For rotate(90) or rotate(-90), expected new width and height is width=oldHeight and height=oldWidth. However, existing algorithms is adding an extra pixel to the rotated image.
  • This algorithm should be faster than previous one. Time complexity should be O(w*h).

Tasks

  • Add tests
  • Update Documentation
  • Update jimp.d.ts
  • Add SemVer Label

Release Notes

Fixes a bug where rotating by 90 degrees introduced extra pixels

@black-turtle
Copy link
Contributor Author

Hi @hipstersmoothie
Most probably we also need to change the Major version. As rotate behavior is changing. Do you want me to change the Major version in package.json file?

@hipstersmoothie
Copy link
Collaborator

How would this be a breaking change? It seems to fix a bug.

@black-turtle
Copy link
Contributor Author

OK, sounds good. No version change needed then.

@hipstersmoothie hipstersmoothie added the patch Increment the patch version when merged label Feb 25, 2023
@hipstersmoothie hipstersmoothie merged commit 97c657e into jimp-dev:main Feb 25, 2023
@github-actions
Copy link
Contributor

🚀 PR was released in v0.22.7 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Increment the patch version when merged released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rotate(90) should have resulting width===oldHeight and height===oldWidth

2 participants