-
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): return correct height #25150
Conversation
When both a maxWidth and maxHeight option is provided, the height of the image should be determined by the height and width of the image if the image is smaller than the provided maxWidth and maxHeight options. i.e. if the maxWidth and maxHeight option is 3840 and 2160, but the image is 720 x 1080, the maxHeight should be 1080. fixes gatsbyjs#25149
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.
LGTM, just need to update the . Thanks for finding the bug and sending through a PR! 😀fixed
version too
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.
😱 Oh my, awesome catch! Thank you 🙏 you rock! 💯
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.
😱 Oh my, awesome catch! Thank you 🙏 you rock! 💯
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.
😱 Oh my, awesome catch! Thank you 🙏 you rock! 💯
@imakida tests are failing, you'll need to update the snapshots. eg This sharp test failing due to height values differing from current snapshot:
|
Return correct height when both `maxHeight` and `maxWidth` are provided for fluid images. We need to distinguish based on the `option`, specifically, `INSIDE` and `COVER` (default if none provided). fixes gatsbyjs#25149
Update snapshot to expect the correct height for when the fit is "inside". fix gatsbyjs#25149
@polarathene I made changes to correct the issue with the default |
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.
Great, thanks for sorting out those tests!
@wardpeet will merge it after the weekend I assume 😀
@wardpeet Please merge? :) |
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.
Thank you! Sorry to keep you waiting.
Holy buckets, @imakida — we just merged your PR to Gatsby! 💪💜 Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! |
When both a maxWidth and maxHeight option is provided, the height of the
image should be determined by the height and width of the image if the
image is smaller than the provided maxWidth and maxHeight options. i.e.
if the maxWidth and maxHeight option is 3840 and 2160, but the image is
720 x 1080, the maxHeight should be 1080.
fixes #25149
Description
Documentation
Related Issues