-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Yet another "Input file contains unsupported image format" question #3509
Comments
Hi, this looks like a Windows bitmap (BMP) file.
|
Thanks @lovell ! So the root cause is the file extension isn't correct. I'll try to detect this scenario in some gatsby plugins then. |
@tx0c sharp does not support Windows BMP files. These are completely unrelated to the PNG format. |
but it's same BMP format as pointed in above #3509 (comment) so can I file a feature request for Windows BMP files? if the browser can show it no problem, why cannot sharp process it? |
Question about an existing feature
My gatsby site building fails due to this error: "Input file contains unsupported image format". By troubleshooting, I found it's related to the png images on my site. These png images are generated by a famous company WeChat and I can NOT change the generating process.
I tried to let the gatsby building process ignore the error and continue, but failed, see gatsbyjs/gatsby#37165.
The author of gatsby thinks if
sharp
thinks an image is corrupt, thengatsby
will respect and throw and so stops building.But from a normal person's point of view, the images are looking good. I'll paste a typical image that will fail the building process here:
So may I ask for your kind advice on how to fix this issue? It's apparently my issue, but I failed to fix it for a long time.
What is the root cause that makes the
sharp
think it's corrupted?To reproduce the error, I put the image to the
sharp
, and called.metadata
:The test output:
What are you trying to achieve?
I want to know why
metadata
fails when processing the image, and what's the best way to make it NOT throw?Tried with
failOn: 'none'
, but it doesn't work. See #3480.When you searched for similar issues, what did you find that might be related?
Didn't find the specific case.
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question
See above:
Please provide sample image(s) that help explain this question
The text was updated successfully, but these errors were encountered: