JS - get image width and height from the base64 code

bombastic picture bombastic · Jul 21, 2013 · Viewed 72k times · Source

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

Answer

gp. picture gp. · Jul 21, 2013
var i = new Image(); 

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

i.src = imageData;