For some unknown reason, any publicly accessible png image files in our publish directory aren’t accessible in branch previews. They are getting sent with the proper header information but for some reason that content has been garbled in some way that we don’t understand. Any help is greatly appreciated.
Errors received
Examples:
Example images that FAIL to load:
"https://dev--pronto-web.netlify.app/images/common/full-arrow.png"
"https://dev--pronto-web.netlify.app/images/common/hamburger-icon.png"
"https://dev--pronto-web.netlify.app/images/fileicons/pdf_icon.png"
// and any other `png` images
Example images that SUCCESSFULLY load:
"https://dev--pronto-web.netlify.app/images/common/dot.svg"
"https://dev--pronto-web.netlify.app/images/common/no-search-results-dark.svg"
// and any other `svg` images
Debugging information:
HTTP/2 200
accept-ranges: bytes
age: 0
cache-control: public,max-age=60, s-maxage=86400,must-revalidate
cache-status: "Netlify Edge"; fwd=miss
content-type: image/png
date: Mon, 08 Jan 2024 20:57:57 GMT
etag:
"2e5ac9fc90xxxxxxxxcf8b66bff3f2b3-ss1"
server: Netlify
strict-transport-security: max-age=31536000; includeSubDomains; preload vary: Accept-Encoding x-nf-request-id: 01HKNDxxxxxxxxxxxxOVYPXWBMFVNP
As you can see above, the content type is correctly coming through as image/png
, but the actual content is severely distorted, which you can see in this screenshot comparison of the binary data (since Netlify won’t let me embed the screenshot here directly).
We’ve validated that all of these files correctly exist in our deploy bundle, as you can see in this screenshot here (since Netlify won’t let me embed the screenshot here directly).
We’re not using Netlify Large Media or anything like that so we don’t expect our image files to be processed in any way, but it appears something is happening to the png
images before they are passed through to the requesting client.
This issue appears similar to this github issue "Error: Input file contains unsupported image format" on Netlify (works locally) · Issue #2591 · lovell/sharp · GitHub where another user is complaining that images aren’t being processed properly and are being encoded into ASCII
text which appears to be the encoding used in our case as well.
Please help
Any information you can provide would be much appreciated. Thank you!