jimp-dev / jimp-dev/jimp

How to set bitmap with DataURL

Open
#1,023 0 comments 1 reaction 0 assignees View on GitHub
bug help wanted
Dominant language
TypeScript
Stars
14.7k
Forks
777
PR merge metrics
No merged PRs in 30d

Description

```javascript
const setdpi = () => ({

setdpi (dpi, callback) {

if ( typeof dpi !== 'number' ) return throwError.call(this, '( dpi ) must be a number', callback);

this.getBase64Async(this._originalMime).then( b64 => {
const [ none, b64_dpi ] = changeDPI.changeDpiDataUrl(b64, dpi).split(',')
const b64_buffer = Buffer.from( b64_dpi, 'base64' )
this.bitmap.data = b64_buffer
})

return this

}

})
```
the code above does not work, so what is the problem

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.