1.

How to get image width height in angular js, before uploading a file?

Answer»

getCheckDimenstions(EV: EVENT) {
   if (ev && ev.target && ev.target.files) {
     CONST file = ev.target.files[0];
     const IMG = new Image();
     img.onload = function() {
       alert('Width:' + this.width + ' HEIGHT: ' + this.height);
     };
     img.src = URL.createObjectURL(file);
  }
}



Discussion

No Comment Found