function readFileAsImage(imageFile) {
  let fr = new FileReader();

  return new Promise(function (resolve, reject) {
    fr.onerror = function () {
      fr.abort();
      reject(new DOMException("Problem parsing input file."));
    };

    fr.onload = function () {
      resolve(fr.result);
    };
    fr.readAsDataURL(imageFile);
  });
}
/**
  * @desc reads image file
  * @param file imageFile - the file to be read
  * @return promise - resolves with image data URL
*/
@desc reads image file
@param file imageFile - the file to be read
@return promise - resolves with image data URL
@desc reads image file @param file imageFile - the file to be read @return promise - resolves with image data URL
function readFileAsImage(imageFile) {
  let fr = new FileReader();
  return new Promise(function (resolve, reject) {
    fr.onerror = function () {
      fr.abort();
      reject(new DOMException("Problem parsing input file."));
    };
    fr.onload = function () {
      resolve(fr.result);
    };
    fr.readAsDataURL(imageFile);
  });
}
function readFileAsImage ( imageFile ) { let fr = new FileReader ( ) ; return new Promise ( function ( resolve , reject ) { fr . onerror = function ( ) { fr . abort ( ) ; reject ( new DOMException ( "Problem parsing input file." ) ) ; } ; fr . onload = function ( ) { resolve ( fr . result ) ; } ; fr . readAsDataURL ( imageFile ) ; } ) ; }
@desc reads image file
 @param file imageFile - the file to be read
 @return promise - resolves with image data URL
@desc reads image file @param file imageFile - the file to be read @return promise - resolves with image data URL