[gatsby-source-contentful] placeholder ignores original format and transparency when using CDN #32699
Closed
2 tasks done
Labels
topic: source-contentful
Related to Gatsby's integration with Contentful
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
We use PNG images with transparency, and use the Contentful CDN instead of downloading the images locally. However, when using the
BLURRED
option, the base64 placeholder is converted to jpg and given a white background.Placeholder:

Final image:

Unfortunately we've just switched back to BLURRED after trialling TRACED_SVG since Gatsby 3.8, so don't know which version this occured in yet, but in 3.8 BLURRED was fine.
I cannot reproduce this using
gatsby-plugin-image
withgatsby-source-filesystem
, so I believe this to be agatsby-source-contentful
specific issue.Using the reproduction, here is the GraphQL output for Contentful asset showing local vs CDN:
Reproduction Link
https://github.com/yourheights/gatsby-issue-reproduction/tree/gatsby-plugin-contentful-cdn-placeholder-base64
Steps to Reproduce
StaticImage
placeholder: BLURRED
placeholder: BLURRED
...
Expected Result
Placeholder respects transparent PNGs.
Actual Result
Placeholder is converted to JPEG format and therefore, ignores transparency.
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: