jimp-dev / jimp-dev/jimp

TypeError: Jimp.read is not a function

Open
#1,350 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
14.7k
Forks
777
PR merge metrics
No merged PRs in 30d

Description

I expect to be able to use the `Jimp.read()` function to load and manipulate images without encountering an error.
The `Jimp.read()` function is throwing a `Jimp.read is not a function` error, and I'm unable to proceed with loading images.

```
> TypeError: Jimp.read is not a function
> at processImageWithCorrections (/Users/yomna/Coding/Mobile Apps/Work/wright/functions/services/services.js:86:30)
> at /Users/yomna/Coding/Mobile Apps/Work/wright/functions/index.js:41:28
> at async runFunction (/Users/yomna/.nvm/versions/node/v18.20.4/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:506:9)
> at async runHTTPS (/Users/yomna/.nvm/versions/node/v18.20.4/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:531:5)
> at async /Users/yomna/.nvm/versions/node/v18.20.4/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:694:21
```

1. Install Jimp version `1.6.0` using npm.
2. Use the following code to load an image:
```javascript
const Jimp = require('jimp');

Jimp.read(imageUrl)
.then(image => {
// manipulate image
})
.catch(err => {
console.error(err);
});
```
3. Run the script and observe the error: `Jimp.read is not a function`.

- Jimp Version: 1.6.0
- Operating System: macOS Sequoia
- Node version: 18.20.4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.