Answers for "buffer to image nodejs"

0

node js download image from url as buffer

var request = require('request').defaults({ encoding: null });
request.get(s3Url, function (err, res, body) {
      //process exif here
});
Posted by: Guest on August-11-2020
0

buffer to image nodejs

function toBase64(arr) {
   //arr = new Uint8Array(arr) if it's an ArrayBuffer
   return btoa(
      arr.reduce((data, byte) => data + String.fromCharCode(byte), '')
   );
}

$('#two').prepend($('<img>',{id:'theImg2',src:`data:image/png;base64,${toBase64( selected[0].image2.data)}`}))
Posted by: Guest on September-16-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language