-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(gatsby-plugin-sharp): Image rotation #14302
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, looking good. Thanks for fixing this one!
Fair enough. Thank you. I'm not sure why that gatsby-image test is failing. Is this fix breaking something else or is that unrelated? |
Co-Authored-By: Ward Peeters <[email protected]>
Co-Authored-By: Ward Peeters <[email protected]>
Co-Authored-By: Ward Peeters <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
Description
Rotating images with gatsby-plugin-sharp via the
rotate
argument is currently broken.The plugin uses sharp's rotate method without args to lock-in orientation from EXIF. Unfortunately, this makes additional calls to rotate ineffectual.
This PR adds a check for the rotate arg and skips the early rotate call if the arg is provided and not equal to zero.
Related Issues
Fixes #5086