0

How to get image size using JavaScript?

JavaScript
var img = new Image();
img.onload = function() {
  console.log(this.width + 'x' + this.height);
}
img.src = 'http://www.google.com/intl/en_ALL/images/logo.gif';
RUN
add comment
Suggest a different solution or add another example