Last active
June 30, 2016 10:29
-
-
Save psycalc/655e7ecf39a7818952a38f47d189d586 to your computer and use it in GitHub Desktop.
Get image size from url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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