gatsby: [gatsby-transformer-sharp] Transparent PNG image transform to Webp does not create correct image
Description
Transparent PNG image transform to Webp does not create correct image.
I have tested with the following script
const sharp = require("sharp");
sharp("docker.png").webp().toFile("output.webp");
This produce a correct Webp image which make me believe this is a Gatsby problem.
Steps to reproduce
{
resolve: "gatsby-remark-images",
options: {
maxWidth: 1200,
withWebp: true,
quality: 85,
tracedSVG: false,
showCaptions: true
}
}
Expected result
Actual result
Environment
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
Binaries:
npm: 6.9.0
Languages:
Python: 3.7.0
Browsers:
Edge: 42.17134.1.0
npmPackages:
gatsby: ^2.7.5 => 2.7.5
gatsby-image: ^2.1.2 => 2.1.2
gatsby-plugin-manifest: ^2.1.1 => 2.1.1
gatsby-plugin-offline: ^2.1.1 => 2.1.1
gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12
gatsby-plugin-sass: ^2.0.11 => 2.0.11
gatsby-plugin-sharp: ^2.1.2 => 2.1.2
gatsby-plugin-typescript: ^2.0.15 => 2.0.15
gatsby-remark-external-links: 0.0.4 => 0.0.4
gatsby-remark-images: ^3.0.14 => 3.0.14
gatsby-remark-prismjs: ^3.2.9 => 3.2.9
gatsby-source-filesystem: ^2.0.37 => 2.0.37
gatsby-transformer-remark: ^2.3.12 => 2.3.12
gatsby-transformer-sharp: ^2.1.20 => 2.1.20
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 12
- Comments: 34 (12 by maintainers)
I don’t believe this issue should be marked as stale yet
@wardpeet - would it be possible to get an update on this issue?
It’s been an issue for around half a year for our windows developers. I’m wondering if there is a temporary workaround we can use for now.
Hi, I’ve been experiencing the same issue for months. I’m on Windows 10. My colleague who works on a Mac has never had this issue. Also we never had the issue on Netlify nor on AWS Amplify.
` // package.json
`
Seems a legit issue on windows, probably going to be upstream but doesn’t really harm to see if we can fix it in gatsby.
Can y’all run
gatsby info
and copy and paste it?This should have been fixed in 2.23.21.
This is an issue for me as well, and it seemingly not completely related to sharp. See this comment: https://github.com/lovell/sharp/issues/2072#issuecomment-582593208
Indeed it is fixed by updating from 2.22.x to latest (2.24.x) Thanks for the heads up!
meanwhile we wait the real solution you can use WebP only in production (non windows env)
Hello, I am also experiencing the same problem using windows 10. Trying the exact same code on Ubuntu 18.04.3, the webp images are generated correctly…