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

fix(gatsby-plugin-sharp): Image rotation #14302

Merged
merged 6 commits into from
May 28, 2019
Merged

Conversation

cwgw
Copy link
Contributor

@cwgw cwgw commented May 24, 2019

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

@cwgw cwgw changed the title Fix gatsby-plugin-sharp rotation fix(gatsby-plugin-sharp): Image rotation May 24, 2019
Copy link
Contributor

@wardpeet wardpeet left a 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!

packages/gatsby-plugin-sharp/src/index.js Outdated Show resolved Hide resolved
packages/gatsby-plugin-sharp/src/process-file.js Outdated Show resolved Hide resolved
packages/gatsby-plugin-sharp/src/trace-svg.js Outdated Show resolved Hide resolved
@cwgw
Copy link
Contributor Author

cwgw commented May 25, 2019

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?

Copy link
Contributor

@wardpeet wardpeet left a 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!

@wardpeet wardpeet merged commit 5e4bf34 into gatsbyjs:master May 28, 2019
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.

resize(rotate: xx) in gatsby-transformer-sharp is not work.
3 participants