JSFiddle - React, Tailwind, and code Playground
SVG test cross browser
by Hugo Carneiro
HTML
<img src="https://cdn.api.fliplet.com/v1/media/files/366199/contents?auth_token=eu--session--855baffe85b8ed848e0b1f4e4e9a7447-368-200-5708" width="150" height="150"/>
CSS
img {
max-width: 100%;
height: auto;
}
JavaScript
var image = $(document).find('img')[0];
var downloadingImage = new Image();
downloadingImage.onload = function() {
image.src = this.src;
var imageWidth = image.width; // Use image.width instead
var imageHeight = image.height; // Use image.height instead
alert('Width: ' + imageWidth + ', Height: ' + imageHeight);
};
downloadingImage.src = image ? image.src : ''