-
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
Add avif format support to gatsby remark images package #28927
Add avif format support to gatsby remark images package #28927
Conversation
></span> | ||
<picture> | ||
<source | ||
srcset=\\"not-a-real-dir/images/my-image.jpeg, not-a-real-dir/images/my-image.jpeg\\" |
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.
shouldn't there be an avif image here?
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.
No, it's okay, because jest mocked fluid function here.
gatsby/packages/gatsby-remark-images/src/__tests__/index.js
Lines 7 to 17 in 46606d3
fluid({ file, args }) { | |
return Promise.resolve({ | |
aspectRatio: 0.75, | |
presentationWidth: 300, | |
originalImg: file.absolutePath, | |
src: file.absolutePath, | |
srcSet: `${file.absolutePath}, ${file.absolutePath}`, | |
sizes: `(max-width: ${args.maxWidth}px) 100vw, ${args.maxWidth}px`, | |
base64: `data:image/png;base64,iVBORw`, | |
}) | |
}, |
This function just returns the string with absolute paths in it as srcSet, without format transform.
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.
Tested locally & works great. Thanks!
Hi @AlexRAV @LekoArts, Config
Version
|
I think that the schema hasn't been updated https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-remark-images/src/gatsby-node.js#L51 |
I see 👀. Happy to make a PR for the official docs if this is the case. |
* Add avif format support to gatsby remark images package * Add withAvif info into readme * Add devault value for withAvif option * Updated snapshot * Added test for withAvif option
Description
Improvement of gatsby remark images package to support AVIF image format.
Documentation
Feature description added to Readme.md
Related Issues
#28894