trekhleb / trekhleb/javascript-algorithms
Error: node-canvas was built without JPEG support
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 197k
- Forks
- 31k
- PR merge metrics
- No merged PRs in 30d
Description
This error occurd when I was running the file
src/algorithms/image-processing/seam-carving/tests/resizeImageWidth.test.js
at Object.<anonymous> (~/javascript-algorithms-master/src/algorithms/image-processing/seam-carving/__tests__/resizeImageWidth.test.js:45:7)
describe('resizeImageWidth', () => {
it('should perform content-aware image width reduction', () => {
// @see: https://jestjs.io/docs/asynchronous
return Promise.all([
loadImage(testImageBeforePath), // ERROR at this line !!!
loadImage(testImageAfterPath),
]).then(([imgBefore, imgAfter]) => {
// Original image.
// ...
});
});
});
Do I need to reinstall canvas?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/algorithms/image-processing/seam-carving/tests/resizeImageWidth.test.js, especially the loadImage call at line 45. Reproduce the failure and inspect how node-canvas is installed and configured for JPEG support. Done means the test runs without the reported JPEG-support error, or the required setup is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100