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

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

Closed
arnhrwd opened this issue Oct 18, 2022 · 3 comments · Fixed by #1209
Closed

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

arnhrwd opened this issue Oct 18, 2022 · 3 comments · Fixed by #1209

Comments

@arnhrwd
Copy link

arnhrwd commented Oct 18, 2022

Expected Behavior

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

Current Behavior

rotate(90) provides a rotated image with incorrect dimensions. Code for the plugin indeed shows it does things like uni-laterally increase the resulting width and height to be an even number, etc.

I assume it is the same for rotate(-90), rotate(180), and rotate(-180)

Probably some special cases could be considered for fast rotate.

  • Jimp Version: ^0.16.2
  • Operating System: Ubuntu
  • Node version: 18.10
@hipstersmoothie
Copy link
Collaborator

@arnhrwd would you mind submitting a PR with the changes you have in mind?

@black-turtle
Copy link
Contributor

black-turtle commented Feb 24, 2023

Hi @hipstersmoothie @arnhrwd if you guys don't mind can I work on this? as this is open for some time.

I am thinking of using Matrix rotation, if rotate angle is multiple of 90 degrees.

I already have a workable solution. If it seems good I will create a PR.

If you want to check the code before PR, please check from here

Thanks!

@hipstersmoothie
Copy link
Collaborator

If this works and the tests pass (and it solves the issue) I would love a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants