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

[gatsby-plugin-sharp] re: make width optional for fixed and fluid images #7520

Closed
wants to merge 2 commits into from

Conversation

alexkirsz
Copy link
Contributor

See #6970.

It turns out transformer-sharp was setting default values anyway at the GraphQL level.

Also, the actual processing of the file when no width is provided was wrong, as it was calling sharp.resize(NaN, height) and throwing.

I did not add tests because I did not figure out a clean way to test processFile. I'm open to suggestions.

Also, I've noticed that the code has a lot of instances of if (args.intValue), which might cause unexpected behavior when intValue is 0. In this case it probably won't matter since it makes no sense to resize an image to size 0.

@alexkirsz
Copy link
Contributor Author

Closing as #7680 and #7671 got merged! 😄

@pieh I also opened #7539 and #7512 at around the same time but I don't know whether the maintainers had time to look at them.

@alexkirsz alexkirsz closed this Sep 3, 2018
@alexkirsz alexkirsz deleted the topics/optional-width-2 branch September 3, 2018 20:09
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.

1 participant