code: function loadImage(src, doExif) {
          var img = new Image();
          img.style.opacity = '0';
          return new Promise(function (resolve, reject) {
              function _resolve() {
                  img.style.opacity = '1';
                  setTimeout(function () {
                      resolve(img);
                  }, 1);
              }
  
              img.removeAttribute('crossOrigin');
              if (src.match(/^https?:\/\/|^\/\//)) {
                  img.setAttribute('crossOrigin', 'anonymous');
              }
  
              img.onload = function () {
                  if (doExif) {
                      EXIF.getData(img, function () {
                          _resolve();
                      });
                  }
                  else {
                      _resolve();
                  }
              };
              img.onerror = function (ev) {
                  img.style.opacity = 1;
                  setTimeout(function () {
                      reject(ev);
                  }, 1);
              };
              img.src = src;
          });
      }
docs: /* Utilities