BUG: gatsby-plugin-sharp does not respect forced format depending on input format #10747
Labels
stale?
Issue that may be closed soon due to the original author not responding any more.
type: upstream
Issues outside of Gatsby's control, caused by dependencies
Description
I've discovered a bug which appears to be due to the
sharp
package, raised an issue there, this is more of a tracker to make suregatsby-plugin-sharp
gets the update when fixed(I think"sharp": "^0.21.0"
in the package json will ensure any fixes are made available, eg0.21.02
?) .If you input a JPEG image and use
toFormat: PNG
in graphql, it will be ignored as the chaining approach presently has a bug where the input formats mimetype will override any prior formats in the pipeline chain, even if they haveforce: true
in their format options set.Steps to reproduce
Use the default starter with a jpg image instead, try force/convert to png with
toFormat: PNG
, notice that with fixed/fluid withgatsby-image
results in png format like desired in the<picture>
element, but thebase64
placeholder is actually jpeg.Expected result
The base64 should be png format.
Actual result
As the pipeline called
.jpeg()
after.png()
and the input type isjpeg
, it ignored.png()
'sforce: true
option, resulting in a base64 in jpeg format.Rearranging the pipeline order provides the expected result(but then breaks it another way due to actual bug).
Environment
Gatsby 2.0.78 in an Alpine Docker container.
The text was updated successfully, but these errors were encountered: