-
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
feat(gatsby-transformer-sharp): Resolver API changes #27783
Conversation
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.
Looks good :) I have nothing concrete but tests are failing so I'll leave them as comments.
@@ -415,6 +415,10 @@ const imageNodeType = ({ | |||
}, | |||
maxHeight: { | |||
type: GraphQLInt, | |||
description: stripIndent` | |||
If set, the generated image is a maximum of this height, cropping if necessary. | |||
If the image layout is "constrained" then the image will be limited to this height. |
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.
Is this true? It's limited to maxHeight for constrained unless the original image height is less than that.
@@ -284,7 +284,7 @@ export const query = graphql` | |||
childImageSharp { | |||
# Specify the image processing specifications right in the query. | |||
# Makes it trivial to update as your page's design changes. | |||
gatsbyImageData(layout: FIXED, width: 125, height: 125) | |||
gatsbyImageData(layout: FIXED, width: 125, height: 125) |
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.
🤦♂️
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.
Looks good to me 👍 But I would prefer another pair of eyes on this as I don't have enough context.
Hello @ascorbic, is this change supposed to work with the current You can see here: https://github.com/didia/didia.me/pull/738/checks?check_run_id=1507185101 |
Hi @didia , |
Following-on from the discussions in #27668, this PR implements the following changes to the resolver:
gatsbyImage
resolver, and is instead returned directly. The resolver is renamed togatsbyImageData
. The new syntax is:jpgOptions
, which are passed to sharp. Eventually we can update the schema to support all relevant sharp options, but currently they just support the same options that were previously supported.blurredOptions
objecttransformOptions
objecttoFormat
andwebP
options with a newformats
option, that accepts an array of formats to generate. The default is[AUTO, WEBP]
, which should be used in most cases.srcSetBreakpoints
. This should be replaced with the equivalentoutputPixelDensities
value.