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

feat(gatsby-plugin-image): Add helper function to grab src #28463

Merged
merged 6 commits into from
Dec 4, 2020

Conversation

laurieontech
Copy link
Contributor

The path to get the src of an image is quite long. Adding a helper function makes this a better DX.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 3, 2020
@laurieontech laurieontech added the topic: media Related to gatsby-plugin-image, or general image/media processing topics label Dec 3, 2020
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 3, 2020
@ascorbic
Copy link
Contributor

ascorbic commented Dec 3, 2020

Might be worth noting (or changing) the fact that if the only format is webp, there is no src just a srcset. As there is no browser that supports webp but not picture elements, we don't bother with the fallback for them.

ascorbic
ascorbic previously approved these changes Dec 3, 2020
Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

@ascorbic ascorbic changed the title (gatsby-plugin-image): Add helper function to grab src feat(gatsby-plugin-image): Add helper function to grab src Dec 3, 2020
@laurieontech
Copy link
Contributor Author

Hmm, is there a scenario where we only produce webp? I thought that was always extra.

@ascorbic
Copy link
Contributor

ascorbic commented Dec 3, 2020

If they specify formats: [WEBP], or if the input file is webp

@laurieontech laurieontech merged commit 4ab296f into master Dec 4, 2020
@delete-merged-branch delete-merged-branch bot deleted the image-helper branch December 4, 2020 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants