Skip to content
Advertisement

JS – get image width and height from the base64 code

I have a base64 img encoded that you can find here. How can I get the height and the width of it?

Advertisement

Answer

var i = new Image(); 

i.onload = function(){
 alert( i.width+", "+i.height );
};

i.src = imageData; 
Advertisement