getBuffer without MIME
See original GitHub issueIs it possible to return the buffer without knowin the MIME?
This example works (by accessing img._originalMime
) but I would prefer an official API
const resize = path => {
return readFile(path)
.then(buffer => Jimp.read(buffer) )
.then(img => img.resize(256, Jimp.AUTO))
.then(img => new Promise((resolve, reject) => { // resize does not return a promise
img.getBuffer(img._originalMime, (err, buffer) => {
if (err) reject(err)
resolve(buffer)
})
}))
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
c# - Is it safe to get the allocated only bytes form a byte array ...
My question is is it safe to assume that I can read the array until I encounter the first 0? Do you know...
Read more >How to use the jimp.MIME_PNG function in jimp - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix issues ... getBuffer, { context: image });...
Read more >Buffer | Node.js v19.3.0 Documentation
The intent is for type to convey the MIME media type of the data, however no validation of the type format is performed....
Read more >Using Buffers in Node.js - DigitalOcean
A buffer is a space in memory (typically RAM) that stores binary data. In Node.js, we can access these spaces of memory with...
Read more >ps_get_buffer - Manual - PHP
It will always return an empty string. The idea for a later implementation is to write the contents of the postscript file into...
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
Have a few requests for a feature like this. Will do a release this week and hopefully add this to the release after.
Thank you!