Skip to content

Instantly share code, notes, and snippets.

@palumbo
Created December 28, 2015 03:01
Show Gist options
  • Save palumbo/8534ebed3e9af19026a8 to your computer and use it in GitHub Desktop.
Save palumbo/8534ebed3e9af19026a8 to your computer and use it in GitHub Desktop.
<script type="text/javascript" src="https://api.filestackapi.com/filestack.js"></script>
<script>
filepicker.setKey('AopG2llxERtqWEaj3lSjQz');
document.getElementById('btn').onclick = function(){
filepicker.pick(
function(Blob){
var url = Blob.url;
console.log(url);
filepicker.stat(
url,
{
width: true,
height: true
},
function(metadata){
var img = document.createElement('img');
img.src = url;
document.getElementById('image').appendChild(img);
var w = metadata.width;
var h = metadata.height;
console.log("height: " + h);
console.log("width: " + w);
document.getElementById('height').innerHTML = h;
document.getElementById('width').innerHTML = w;
document.getElementById('hidden').style.display = 'block';
}
)
}
)
};
/*
document.getElementById('header').onclick = function(){
document.getElementById('hidden').style.display = 'block';
};
*/
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment