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

BUG: gatsby-plugin-sharp does not respect forced format depending on input format #10747

Closed
polarathene opened this issue Jan 1, 2019 · 2 comments
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

Comments

@polarathene
Copy link
Contributor

polarathene commented Jan 1, 2019

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 sure gatsby-plugin-sharp gets the update when fixed(I think "sharp": "^0.21.0" in the package json will ensure any fixes are made available, eg 0.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 have force: 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 with gatsby-image results in png format like desired in the <picture> element, but the base64 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 is jpeg, it ignored .png()'s force: 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.

@sidharthachatterjee sidharthachatterjee added the type: upstream Issues outside of Gatsby's control, caused by dependencies label Jan 1, 2019
@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Feb 11, 2019
@gatsbot
Copy link

gatsbot bot commented Feb 11, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@polarathene
Copy link
Contributor Author

Fixed in sharp 0.21.02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants