How to get image width height in angular js, before uploading a file?
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);
}
}
BY Best Interview Question ON 01 Apr 2020