JS - get image width and height from the base64 code

后端 未结 4 705
攒了一身酷
攒了一身酷 2020-11-27 14:46

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

4条回答
  •  半阙折子戏
    2020-11-27 15:29

    var i = new Image(); 
    
    i.onload = function(){
     alert( i.width+", "+i.height );
    };
    
    i.src = imageData; 
    

提交回复
热议问题