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

Cannot read property 'bitmap' of undefined #8

Open
svengau opened this issue Apr 28, 2020 · 3 comments
Open

Cannot read property 'bitmap' of undefined #8

svengau opened this issue Apr 28, 2020 · 3 comments

Comments

@svengau
Copy link

svengau commented Apr 28, 2020

Hello, I'm using gatsby-plugin-sharp, and I've got the following error message when generating thumbnails:

TypeError: Cannot read property 'bitmap' of undefined
    at Potrace._processLoadedImage (/Users/svengaubert/workspace/fullstackrocket/gatsby-stripe-netlify-cms-tailwindcss/node_modules/potrace/lib/Potrace.js:1002:35)
    at Jimp.<anonymous> (/Users/svengaubert/workspace/fullstackrocket/gatsby-stripe-netlify-cms-tailwindcss/node_modules/potrace/lib/Potrace.js:1050:14)
    at Timeout._onTimeout (/Users/svengaubert/workspace/fullstackrocket/gatsby-stripe-netlify-cms-tailwindcss/node_modules/@jimp/core/dist/index.js:354:25)
Error: Unsupported MIME type: image/webp

After some investigations, it seems JIMP doesn't support webp and sends back the error "Error: Unsupported MIME type: image/webp". But potrace doesn't check this error, and directly pass a null image to _processLoadedImage, as we can see here:

self._processLoadedImage(img);

Would it be possible to check the error before calling _processLoadedImage ?

Thanks

@tooolbox
Copy link
Owner

tooolbox commented May 6, 2020

I see the problem you're describing and I don't see why it shouldn't be fixed.. Do you feel up to submitting a PR?

@mnlfischer
Copy link

is this repo still maintained?

@tooolbox
Copy link
Owner

I don't really have time to maintain this, hence me asking for a PR. Would be open to adding maintainers who have a vested interest in its survival, perhaps the gatsby folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants