Im having trouble obtaining the width and height of an image during the upload function.
Here's the current code I have:
// internal function that creates an input element
var file=newElement("input",0,"");
// sets the input element as type file
file.type="file";
file.multiple="multiple";
file.name="photoupload[]";
file.accept="image/*";
file.onchange=function(e){
// internal function that creates an image element
var img=newElement("img",0,"");
img.src=URL.createObjectURL(this);
img.onload=function(){
var cw=img.clientWidth;
var ch=img.clientHeight;
alert(cw);alert(ch);
}
}
file.click();
Not quite sure how to fix this. Any help appreciated.