JSFiddle - React, Tailwind, and code Playground
JavaScript
var img = new Image();
img.onload = function () {
alert("height: " + img.height + " width:" + img.width);
};
img.src = "https://www.gravatar.com/avatar/d17c95dfa5820a212d979da58bc3435c?s=128&d=identicon&r=PG";