Skip to content

Instantly share code, notes, and snippets.

@psycalc
Last active June 30, 2016 10:29
Show Gist options
  • Save psycalc/655e7ecf39a7818952a38f47d189d586 to your computer and use it in GitHub Desktop.
Save psycalc/655e7ecf39a7818952a38f47d189d586 to your computer and use it in GitHub Desktop.
Get image size from url
function getMeta(url){
var img = new Image();
img.addEventListener("load", function(){
alert( this.naturalWidth +' '+ this.naturalHeight );
});
img.src = url;
}
getMeta("http://.../... .png");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment