error on jimp.read with special base64 image
See original GitHub issueAfter saving a base64 image as png, trying to read it with jimp.read causes the following error.
Error: There are some read requests waiting on finished stream
at module.exports.ChunkStream._end (c:\Users\Baris\Desktop\github\nodebb_vscode\NodeBB\node_modules\pngjs\lib\chunkstream.js:100:7)
at module.exports.ChunkStream.end (c:\Users\Baris\Desktop\github\nodebb_vscode\NodeBB\node_modules\pngjs\lib\chunkstream.js:86:10)
at exports.PNG.PNG.end (c:\Users\Baris\Desktop\github\nodebb_vscode\NodeBB\node_modules\pngjs\lib\png.js:98:16)
at exports.PNG.PNG.parse (c:\Users\Baris\Desktop\github\nodebb_vscode\NodeBB\node_modules\pngjs\lib\png.js:88:8)
at Jimp.parseBitmap (c:\Users\Baris\Desktop\github\nodebb_vscode\NodeBB\node_modules\jimp\index.js:297:17)
at c:\Users\Baris\Desktop\github\nodebb_vscode\NodeBB\node_modules\jimp\index.js:202:29
at c:\Users\Baris\Desktop\github\nodebb_vscode\NodeBB\node_modules\graceful-fs\graceful-fs.js:78:16
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
2018-03-22T12:38:44.435Z [9632] - error: Error: invalid block type
at Inflate.zlibOnError (zlib.js:153:15)
The code
jimp.read(pathToFile, function (err) {
console.log(err);
});
Wrapping the jimp.read in a try catch doesn’t catch the Error:invalid block type
and the processes crashes.
Here is the image used.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14
Top Results From Across the Web
Error cropping a base64 format image using jimp package in ...
The problem is from the base64 string. To make it work, just drop the prefix data:image/jpeg;base64, , and just leave the data. Example...
Read more >error on jimp.read with special base64 image - - Bountysource
After saving a base64 image as png, trying to read it with jimp.read causes the following error. Error: There are some read requests...
Read more >Top 5 jimp Code Examples - Snyk
Learn more about how to use jimp, based on jimp code examples created from the most popular ways it is used in public...
Read more >jimp - npm
An image processing library for Node written entirely in JavaScript, with zero native dependencies. The default jimp configuration. Supported ...
Read more >Convert a Base64 data into an Image in Node.js
Learn how to convert an image into a base64 string and back to an image ... Jimp.read(buffer, (err, res) => { if (err)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @hipstersmoothie I just tested on 0.3.9, and the callback is getting called twice now. Here is the code and the output.
I’m locking this issue please open new issues for help. From first glance you are not using Jimp.read correctly? IDK cause the screenshot has no code and is in chines