src/methods.js
function convertImageToBase64(image) {
  let fileReader = new FileReader();

  return new Promise( (resolve, reject) => {

    fileReader.onload = fileLoadedEvent => resolve(fileLoadedEvent.target.result);

    fileReader.readAsDataURL(image);

  });
}
function convertImageToBase64(image) {
  let fileReader = new FileReader();

  return new Promise( (resolve, reject) => {

    fileReader.onload = fileLoadedEvent => resolve(fileLoadedEvent.target.result);

    fileReader.readAsDataURL(image);

  });
}
function convertImageToBase64 ( image ) { let fileReader = new FileReader ( ) ; return new Promise ( ( resolve , reject ) => { fileReader . onload = fileLoadedEvent => resolve ( fileLoadedEvent . target . result ) ; fileReader . readAsDataURL ( image ) ; } ) ; }
Gets image height and width in pixels.
@param {file} image Image file as a blob.
@returns {string} Base64 image string.
Gets image height and width in pixels .