I'm having (probably) easy issue to fix but can't figure it out myself.
Basucally my reader.width
and reader.height
keep saying undefined :/.. everything else works as supposed to
function handleFileSelect(evt, selector) {
var f = evt.target.files[0];
var reader = new FileReader();
reader.onload = (function(theFile) {
return function(e) {
var imgW = reader.width;
var imgH = reader.height;
console.debug("width: "+imgW); // undefined
console.debug("height: "+imgH); // undefined
var thumbHtml = ['<span><img class="thumb" src="', e.target.result,
'" title="', escape(theFile.name), '"/></span>'].join('');
$(selector).parent().siblings('.previewThumb').html(thumbHtml);
$(selector).parent().siblings('.previewThumb').removeClass('hidden')
};
})(f);
// Read in the image file as a data URL.
reader.readAsDataURL(f);
$(selector).siblings('.list').html('<span>'+escape(f.name)+'</span></span>');
}
I tried alsoe.width
and theFile.width
- all of them return undefined :/
I tried to google but according to everything I have read reader.width should work
Appreciate the help
Cheers, Tom